diff options
author | 1997-11-05 02:12:54 +0000 | |
---|---|---|
committer | 1997-11-05 02:12:54 +0000 | |
commit | d0860acc273b53d14d322772ee953215e297bbf6 (patch) | |
tree | 1ae7ab3f9aab5370e96545186696ffacfbbb030a | |
parent | don't try #21 for a: only (diff) | |
download | wireguard-openbsd-d0860acc273b53d14d322772ee953215e297bbf6.tar.xz wireguard-openbsd-d0860acc273b53d14d322772ee953215e297bbf6.zip |
define puts()
-rw-r--r-- | sys/arch/i386/stand/biosboot/biosboot.S | 30 | ||||
-rw-r--r-- | sys/arch/i386/stand/mbr/mbr.S | 37 |
2 files changed, 25 insertions, 42 deletions
diff --git a/sys/arch/i386/stand/biosboot/biosboot.S b/sys/arch/i386/stand/biosboot/biosboot.S index 61d458381b6..fd4072302c6 100644 --- a/sys/arch/i386/stand/biosboot/biosboot.S +++ b/sys/arch/i386/stand/biosboot/biosboot.S @@ -1,4 +1,4 @@ -/* $OpenBSD: biosboot.S,v 1.20 1997/09/05 17:58:49 mickey Exp $ */ +/* $OpenBSD: biosboot.S,v 1.21 1997/11/05 02:12:54 mickey Exp $ */ /* * Copyright (c) 1997 Michael Shalayeff @@ -59,6 +59,12 @@ #else /* !DEBUG */ #define DBGMSG(msg) /* */ #endif /* !DEBUG */ +#define puts(s) \ + data32; \ + movl $s, %esi; \ + /* call Lmessage */; \ + .byte 0xe8; \ + .word Lmessage - . - 2 .text @@ -147,12 +153,7 @@ ebpb: .long 16 /* hidden sectors */ int $0x14 popl %dx #endif - - data32 - movl $1b, %esi - # call Lmessage - .byte 0xe8 - .word Lmessage - . - 2 + puts(1b) data32 xorl %ebx, %ebx /* put it at %es:0 */ @@ -177,8 +178,7 @@ ebpb: .long 16 /* hidden sectors */ jnc 3f /* read error */ - data32 - movl $2f, %esi + puts(2f) jmp 5f 2: .asciz "\r\nRead error\r\n" @@ -195,11 +195,7 @@ ebpb: .long 16 /* hidden sectors */ popl %cx loop 1b - data32 - movl $2f, %esi /* new line */ - # call Lmessage - .byte 0xe8 - .word Lmessage - . - 2 + puts(2f) xorl %si, %si cld @@ -210,12 +206,8 @@ ebpb: .long 16 /* hidden sectors */ .word ZMAGIC je 3f - data32 - movl $1f, %esi + puts(1f) 5: - # call Lmessage - .byte 0xe8 - .word Lmessage - . - 2 cli hlt 1: .ascii "Bad magic" diff --git a/sys/arch/i386/stand/mbr/mbr.S b/sys/arch/i386/stand/mbr/mbr.S index 1c880a41656..173684a720f 100644 --- a/sys/arch/i386/stand/mbr/mbr.S +++ b/sys/arch/i386/stand/mbr/mbr.S @@ -1,4 +1,4 @@ -/* $OpenBSD: mbr.S,v 1.11 1997/08/29 19:47:24 mickey Exp $ */ +/* $OpenBSD: mbr.S,v 1.12 1997/11/05 02:14:18 mickey Exp $ */ /* * Copyright (c) 1997 Michael Shalayeff and Tobias Weingartner @@ -66,6 +66,12 @@ #else /* !DEBUG */ #define DBGMSG(msg) #endif /* !DEBUG */ +#define puts(s) \ + data32; \ + movl $s, %esi; \ + /* call Lmessage */; \ + .byte 0xe8; \ + .word Lmessage - . - 2 .text @@ -161,10 +167,7 @@ reloc: * and then hardcode the boot drive to * 0x80. */ - data32 - movl $fdmbr, %esi - data32 - call message + puts(fdmbr) /* If we are passed bogus data, set it to HD #1. * We should load the value from a hard coded @@ -187,10 +190,7 @@ reloc: .word signature .word DOSMBR_SIGNATURE je sigok - data32 - movl $esig, %esi - data32 - call message + puts(esig) /* find the first active partition * Note: this should be the only active @@ -216,10 +216,7 @@ sigok: /* No bootable partition */ no_part: - data32 - movl $noboot, %esi - data32 - call message + puts(noboot) err_stop: cli hlt @@ -274,18 +271,12 @@ found: xorl %bx, %bx /* put it at %es:0 */ int $0x13 jnc 1f - data32 - movl $eread, %esi - data32 - call message + puts(eread) jmp err_stop 1: DBGMSG(CHAR_G) - data32 - movl $info, %esi - data32 - call message + puts(info) # jump to the new code (%ds:%si is at the right point) data32 @@ -295,7 +286,7 @@ found: /* * Display string */ -message: +Lmessage: pushl %eax cld 1: @@ -307,7 +298,7 @@ message: jmp 1b # -# message: write the error message in %ds:%si to console +# chr: write the error message in %ds:%si to console # chr: pushl %eax |