Changeset 7b7d7d1 in mainline
- Timestamp:
- 2005-04-10T20:01:39Z (20 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 34b20f5d
- Parents:
- 23c0c08
- Location:
- arch/ia32
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
arch/ia32/Makefile.inc
r23c0c08 r7b7d7d1 14 14 15 15 CPPFLAGS=$(DEFS) -nostdinc -I../include 16 CFLAGS=$(CPPFLAGS) -nostdlib -fno-builtin -fomit-frame-pointer -Wmissing-prototypes -Werror -O 116 CFLAGS=$(CPPFLAGS) -nostdlib -fno-builtin -fomit-frame-pointer -Wmissing-prototypes -Werror -O3 17 17 LFLAGS=-M -no-check-sections -T ../arch/ia32/_link.ld 18 18 -
arch/ia32/boot/boot.S
r23c0c08 r7b7d7d1 35 35 36 36 37 # KERNEL_SIZE is passed from the outside to the preprocessor 38 #if (KERNEL_SIZE%512>0) 39 #define TAIL 1 40 #else 41 #define TAIL 0 42 #endif 43 44 #define SECTORS (KERNEL_SIZE/512+TAIL) 45 37 46 .text 38 47 .global _start_0x7c00 … … 42 51 xorw %ax,%ax # reset, %al will be used below 43 52 movw %ax,%dx # fd0, %dh and %dl will be used below 44 int $0x13 53 movw %dx,%ds 54 55 movw %dx,%ss # initialize stack 56 movw $stack,%sp 57 58 int $0x13 # reset floppy 45 59 jc stop_trying 46 60 47 movb $2,%ah # read 48 incb %al # one sector 49 movb %ah,%cl # from disk sector 2 50 movw %dx,%es 61 movw %dx,%ds 62 movw %dx,%ss 63 movw $0x7c00,%sp 64 movw $0xffe0,%si # after next increment, %si will become 0x0000 65 movw %si,%es 51 66 movw $0x8000,%bx # at %es:%bx 52 int $0x1353 jc stop_trying54 55 pushw $('.')56 call echo_mark57 add $2,%sp58 59 movw %dx,%ds60 67 61 # KERNEL_SIZE is passed from the outside to the preprocessor 62 movl $(KERNEL_SIZE),%edi 68 movl $(SECTORS),%edi 63 69 64 shrl $9,%edi # number of sectors that kernel occupies (%edi div 512)65 66 70 read_next: 67 71 test %edi,%edi … … 72 76 outb %al,%dx 73 77 74 pushw $('$')78 movb $('$'),%al 75 79 call echo_mark 76 add $2,%sp77 80 78 81 jmpl $0,$0x8000 79 82 80 83 read_sectors: 81 pushw $('.')84 movb $('.'),%al 82 85 call echo_mark 83 add $2,%sp84 86 85 87 decl %edi … … 105 107 jnc read_next 106 108 107 pushw $('R')109 movb $('R'),%al 108 110 call echo_mark 109 add $2,%sp110 111 111 112 xorw %ax,%ax # try to reset … … 115 116 116 117 stop_trying: 117 pushw $('F')118 movb $('F'),%al 118 119 call echo_mark 119 add $2,%sp120 120 121 121 cli … … 128 128 pusha 129 129 130 movw CH(%bp),%ax131 130 movb $0xe,%ah 132 131 movb $7,%bl … … 139 138 # current logical sector from the beginning of the disk 140 139 logical_sector: 141 .word 1140 .word 0 142 141 143 142 # number of sectors per track on 1440 floppy 144 143 sectors: 145 144 .byte 18 146 147 145 148 146 # boot floppy signature … … 151 149 .byte 0x55 152 150 .byte 0xaa 151 stack:
Note:
See TracChangeset
for help on using the changeset viewer.