|
|
@@ -137,8 +137,8 @@ e820_done:
|
|
|
call read_sectors
|
|
|
jc pack_fail
|
|
|
|
|
|
- /* Validate the header at 0x70000: "NBROOT1\0", version 1. */
|
|
|
- movl $0x70000, %esi
|
|
|
+ /* Validate the header at 0x3000: "NBROOT1\0", version 1. */
|
|
|
+ movl $0x3000, %esi
|
|
|
movl 0(%esi), %eax
|
|
|
cmpl $0x4F52424E, %eax /* "NBRO" */
|
|
|
jne pack_fail
|
|
|
@@ -170,9 +170,9 @@ load_loop:
|
|
|
subl %eax, %ecx
|
|
|
addl $511, %ecx
|
|
|
shrl $9, %ecx
|
|
|
- cmpl $64, %ecx
|
|
|
+ cmpl $32, %ecx
|
|
|
jbe 1f
|
|
|
- movl $64, %ecx
|
|
|
+ movl $32, %ecx
|
|
|
1: movl %ecx, chunk_sectors
|
|
|
movl pack_off, %eax
|
|
|
shrl $9, %eax
|
|
|
@@ -381,7 +381,7 @@ a20_wait:
|
|
|
|
|
|
/* ---- Read sectors via INT 13h ------------------------------------------
|
|
|
* in: eax = LBA, cx = sector count
|
|
|
- * out: data at 0x70000, CF set on failure
|
|
|
+ * out: data at 0x3000, CF set on failure
|
|
|
* Clobbers all general registers. */
|
|
|
read_sectors:
|
|
|
movl %eax, rd_lba
|
|
|
@@ -392,7 +392,7 @@ read_retry:
|
|
|
movw rd_off, %bx
|
|
|
xorw %ax, %ax
|
|
|
movw %ax, %ds
|
|
|
- movw $0x7000, %ax
|
|
|
+ movw $0x0300, %ax
|
|
|
movw %ax, %es
|
|
|
movb stage_drive, %dl
|
|
|
cmpb $0x80, %dl
|
|
|
@@ -403,7 +403,7 @@ read_lba:
|
|
|
movw $0x10, 0x500
|
|
|
movw $1, 0x502
|
|
|
movw %bx, 0x504
|
|
|
- movw $0x7000, 0x506
|
|
|
+ movw $0x0300, 0x506
|
|
|
movl rd_lba, %eax
|
|
|
movl %eax, 0x508
|
|
|
movl $0, 0x50C
|
|
|
@@ -514,7 +514,7 @@ pack_addr_fallback:
|
|
|
ret
|
|
|
|
|
|
/* ---- Copy a chunk to high memory with INT 15h AH=87h -------------------
|
|
|
- * in: copy_dst (24-bit), copy_len; source is 0x70000.
|
|
|
+ * in: copy_dst (24-bit), copy_len; source is 0x3000.
|
|
|
* Copies in 16-bit words; returns with CF set on failure. */
|
|
|
bios_copy:
|
|
|
movl copy_dst, %eax
|
|
|
@@ -570,7 +570,11 @@ print_hex:
|
|
|
2: addl $48, %eax
|
|
|
3: movb $0x0E, %ah
|
|
|
movb $0x00, %bh
|
|
|
+ pushl %ebx
|
|
|
+ pushl %ecx
|
|
|
int $0x10
|
|
|
+ popl %ecx
|
|
|
+ popl %ebx
|
|
|
loop 1b
|
|
|
popal
|
|
|
ret
|
|
|
@@ -640,16 +644,16 @@ stage2_gdtr:
|
|
|
.long stage2_gdt
|
|
|
|
|
|
/* ---- INT 15h AH=87h descriptor table (48 bytes) -----------------------
|
|
|
- * 16 zero bytes, source descriptor at 0x10 (0x70000, 64 KB), destination
|
|
|
+ * 16 zero bytes, source descriptor at 0x10 (0x3000, 64 KB), destination
|
|
|
* at 0x18 (patched per chunk), 16 zero bytes. */
|
|
|
.align 16
|
|
|
bios_gdt:
|
|
|
.quad 0
|
|
|
.quad 0
|
|
|
- /* source: limit 0xFFFF, base 0x70000, access 0x93, 16-bit data */
|
|
|
+ /* source: limit 0xFFFF, base 0x3000, access 0x93, 16-bit data */
|
|
|
.word 0xFFFF
|
|
|
- .word 0x0000
|
|
|
- .byte 0x07
|
|
|
+ .word 0x3000
|
|
|
+ .byte 0x00
|
|
|
.byte 0x93
|
|
|
.word 0x0000
|
|
|
/* destination: limit 0xFFFF, base patched, access 0x93 */
|