wok-stable rev 540
Etherboot: by the way, add DOS/COM support
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Thu Apr 10 22:34:56 2008 +0000 (2008-04-10) |
parents | 47e6882f05da |
children | 4a87a0aa0476 |
files | etherboot/stuff/etherboot-prefix.u |
line diff
1.1 --- a/etherboot/stuff/etherboot-prefix.u Fri Apr 11 02:05:05 2008 +0200 1.2 +++ b/etherboot/stuff/etherboot-prefix.u Thu Apr 10 22:34:56 2008 +0000 1.3 @@ -1,6 +1,6 @@ 1.4 --- etherboot-5.4.3/src/arch/i386/prefix/liloprefix.S 1.5 +++ etherboot-5.4.3/src/arch/i386/prefix/liloprefix.S 1.6 -@@ -1,92 +1,361 @@ 1.7 +@@ -1,92 +1,393 @@ 1.8 -/* 1.9 - Copyright (C) 2000, Entity Cyber, Inc. 1.10 - 1.11 @@ -85,15 +85,47 @@ 1.12 - a .lilo file is dd'ed to a floppy), print an error message. 1.13 -*/ 1.14 +.equ SYSSEG, 0x1000 /* system loaded at SYSSEG<<4 */ 1.15 - 1.16 --bootsector: 1.17 -- jmp $BOOTSEG, $go - _prefix /* reload cs:ip to match relocation addr */ 1.18 ++ 1.19 + .org 0 1.20 + .arch i386 1.21 + .text 1.22 + .section ".prefix", "ax", @progbits 1.23 + .code16 1.24 + 1.25 +-bootsector: 1.26 +- jmp $BOOTSEG, $go - _prefix /* reload cs:ip to match relocation addr */ 1.27 ++ call here 1.28 ++here: 1.29 ++ pop %ax 1.30 ++ cmpw $0x103, %ax /* COM entry point is cs:0x100 */ 1.31 ++ jne bootsector 1.32 ++/* We need a real mode stack that won't be stomped on by Etherboot 1.33 ++ which starts at 0x20000. Choose something that's sufficiently high, 1.34 ++ but not in DOC territory. Note that we couldn't do this in a real 1.35 ++ .com program since stack variables are in the same segment as the 1.36 ++ code and data, but this isn't really a .com program, it just looks 1.37 ++ like one to make DOS load it into memory. It still has the 64kB 1.38 ++ limitation of .com files though. */ 1.39 ++#define STACK_SEG 0x7000 1.40 ++#define STACK_SIZE 0x4000 1.41 ++ /* Set up temporary stack */ 1.42 ++ movw $STACK_SEG, %ax 1.43 ++ movw %ax, %ss 1.44 ++ movw $STACK_SIZE, %sp 1.45 + 1.46 ++ pushl $0 /* No parameters to preserve for exit path */ 1.47 ++ pushw $0 /* Dummy return address - use prefix_exit */ 1.48 ++ 1.49 ++ /* Calculate segment address of image start */ 1.50 ++ pushw %cs 1.51 ++ popw %ax 1.52 ++ addw $(0x100/16), %ax 1.53 ++ pushw %ax 1.54 ++ pushw $_start 1.55 ++ /* Calculated lcall to _start with %cs:0000 = image start */ 1.56 ++ lret 1.57 ++ 1.58 ++bootsector: 1.59 + jmp $BOOTSEG, $go /* reload cs:ip to match relocation addr */ 1.60 go: 1.61 - movw $0x2000, %di /* 0x2000 is arbitrary value >= length 1.62 @@ -388,8 +420,8 @@ 1.63 + movb $4, %cl 1.64 + movb $0x0e, %ah /* write char, tty mode */ 1.65 + movw $0x0007, %bx /* page 0, attribute 7 (normal) */ 1.66 -+ call print_digit 1.67 -+ call print_digit 1.68 ++ call print_digit2 1.69 ++print_digit2: 1.70 + call print_digit 1.71 +/* fall through */ 1.72 +print_digit: 1.73 @@ -419,7 +451,7 @@ 1.74 + .byte 36,18,15,9 1.75 1.76 +msg1: 1.77 -+ .ascii "Loading ROM image" 1.78 ++ .ascii "Loading ROM" 1.79 +msg1end: 1.80 1.81 .org 497