Lines Matching +full:0 +full:x7c00
17 .set MEM_REL,0x700 # Relocation address
18 .set MEM_ARG,0x900 # Arguments
19 .set MEM_ORG,0x7c00 # Origin
20 .set MEM_BUF,0x8c00 # Load area
21 .set MEM_BTX,0x9000 # BTX start
22 .set MEM_JMP,0x9010 # BTX entry point
23 .set MEM_USR,0xa000 # Client start
24 .set BDA_BOOT,0x472 # Boot howto flag
27 .set PRT_OFF,0x1be # Partition offset
28 .set PRT_NUM,0x4 # Partitions
29 .set PRT_BSD,0xa5 # Partition type
32 .set FL_PACKET,0x80 # Packet mode
35 .set SIZ_PAG,0x1000 # Page size
36 .set SIZ_SEC,0x200 # Sector size
38 .set NSECT,0x10
59 .org 0x03, 0x00
60 oemid: .space 0x08, 0x00 # OEM ID
62 .org 0x0b, 0x00
64 .byte 0 # sectors/clustor
65 .word 0 # reserved sectors
66 .byte 0 # number of FATs
67 .word 0 # root entries
68 .word 0 # small sectors
69 .byte 0 # media type (W)
70 .word 0 # sectors/fat
73 .long 0 # hidden sectors (W)
74 .long 0 # large sectors
76 .org 0x24, 0x00
77 ebpb: .byte 0 # BIOS physical drive number (W)
79 .org 0x25,0x90
96 pushl $0x0 # absolute
104 push $0x10 # Size of packet
107 lea 0x10(%bp),%sp # Clear stack
115 * Setup the segment registers to flat addressing (segment 0) and setup the
125 * Relocate ourself to MEM_REL. Since %cx == 0, the inc %ch sets
126 * %cx == 0x100. Note that boot1 does not use this relocated copy
144 cmpb $0x80,%dl # Hard drive?
146 movb $0x1,%dh # Block count
148 mov $0x1,%cx # Two passes
150 movb $0x1,%dh # Partition
151 main.2: cmpb $PRT_BSD,0x4(%si) # Our partition type?
154 testb $0x80,(%si) # Active?
156 main.3: add $0x10,%si # Next entry
158 cmpb $0x1+PRT_NUM,%dh # In table?
169 * Floppies use partition 0 of drive 0.
176 * we read it in, we conveniently use 0x8c00 as our transfer buffer. Thus,
177 * boot1 ends up at 0x8c00, and boot2 starts at 0x8c00 + 0x200 = 0x8e00.
178 * The first part of boot2 is the disklabel, which is 0x200 bytes long.
179 * The second part is BTX, which is thus loaded into 0x9000, which is where
182 * binary to 0xc000. Normally, BTX clients start at MEM_USR, or 0xa000, but
183 * when we use btxld to create boot2, we use an entry point of 0x2000. That
184 * entry point is relative to MEM_USR; thus boot2.bin starts at 0xc000.
190 mov 0xa(%bx),%si # Get BTX length and set
206 inb $0x64,%al # Get status
207 testb $0x2,%al # Busy?
209 movb $0xd1,%al # Command: Write
210 outb %al,$0x64 # output port
211 seta20.2: inb $0x64,%al # Get status
212 testb $0x2,%al # Busy?
214 movb $0xdf,%al # Enable
215 outb %al,$0x60 # A20
225 mov 0x8(%si),%ax # Get
226 mov 0xa(%si),%cx # LBA
241 int $0x16 # keypress
242 movw $0x1234, BDA_BOOT # Do a warm boot
243 ljmp $0xf000,$0xfff0 # reboot the machine
247 putstr.0: mov $0x7,%bx # Page:attribute
248 movb $0xe,%ah # BIOS: Display
249 int $0x10 # character
252 jne putstr.0 # No
259 ereturn: movb $0x1,%ah # Invalid
274 cmpb $0x80,%dl # Hard drive?
276 mov $0x55aa,%bx # Magic
278 movb $0x41,%ah # BIOS: Check
279 int $0x13 # extensions present
282 cmp $0xaa55,%bx # Magic?
284 testb $0x1,%cl # Packet interface?
287 movb $0x42,%ah # BIOS: Extended
288 int $0x13 # read
291 movb $0x8,%ah # BIOS: Get drive
292 int $0x13 # parameters
296 andb $0x3f,%cl # Sectors per track
299 mov 0x8(%bp),%eax # Get LBA
311 cmpl $0x3ff,%eax # Cylinder number supportable?
315 rorb $0x2,%al # number
321 mov 0x2(%bp),%ah # Blocks to read
329 read.2: mov $0x5,%di # Try count
330 read.3: les 0x4(%bp),%bx # Transfer buffer
332 movb $0x2,%ah # BIOS: Read
333 int $0x13 # from disk
339 int $0x13 # disk system
343 add %ax,0x8(%bp) # Adjust
345 incw 0xa(%bp) # transfer
347 add %bl,0x5(%bp) # pointer,
348 sub %al,0x2(%bp) # block count
361 .org PRT_OFF,0x90
365 .fill 0x30,0x1,0x0
366 part4: .byte 0x80, 0x00, 0x01, 0x00
367 .byte 0xa5, 0xfe, 0xff, 0xff
368 .byte 0x00, 0x00, 0x00, 0x00
369 .byte 0x50, 0xc3, 0x00, 0x00 # 50000 sectors long, bleh
371 .word 0xaa55 # Magic number