summaryrefslogtreecommitdiffstats
path: root/src/arch/i386/prefix/bootpart.S
diff options
context:
space:
mode:
authorMichael Brown2007-07-05 13:58:16 +0200
committerMichael Brown2007-07-05 13:58:16 +0200
commit66208dd65d41e0babe27d270917fe71674102884 (patch)
treeb47d5f2134cf8a05ff441cb284f004e846f29cd3 /src/arch/i386/prefix/bootpart.S
parentMiscellaneous efficiency improvements, and extend read_sectors to (diff)
downloadipxe-66208dd65d41e0babe27d270917fe71674102884.tar.gz
ipxe-66208dd65d41e0babe27d270917fe71674102884.tar.xz
ipxe-66208dd65d41e0babe27d270917fe71674102884.zip
hdprefix that works for LBA only
Diffstat (limited to 'src/arch/i386/prefix/bootpart.S')
-rw-r--r--src/arch/i386/prefix/bootpart.S33
1 files changed, 21 insertions, 12 deletions
diff --git a/src/arch/i386/prefix/bootpart.S b/src/arch/i386/prefix/bootpart.S
index 22ad3e3a..d60fe9bc 100644
--- a/src/arch/i386/prefix/bootpart.S
+++ b/src/arch/i386/prefix/bootpart.S
@@ -44,7 +44,7 @@ find_active_partition:
jc 1f
cmpw $0xaa55, %bx
jne 1f
- movw $read_lba, read_sector
+ movw $read_lba, read_sectors
1:
/* Read and process root partition table */
xorb %dh, %dh
@@ -55,17 +55,26 @@ find_active_partition:
/* Print failure message */
movw $10f, %si
- movw $(20f-10f), %cx
-1: movw $0x0007, %bx
+ jmp boot_error
+10: .asciz "Could not locate active partition\r\n"
+
+/*
+ * Print failure message and boot next device
+ *
+ * Parameters:
+ * %si : Failure string
+ */
+boot_error:
+ cld
+ movw $0x0007, %bx
movb $0x0e, %ah
- lodsb
+1: lodsb
+ testb %al, %al
+ je 99f
int $0x10
- loop 1b
-
- /* Boot next device */
+ jmp 1b
+99: /* Boot next device */
int $0x18
-10: .ascii "Could not locate active partition\r\n"
-20:
/*
* Process partition table
@@ -149,7 +158,7 @@ process_partition:
read_boot_sector:
pushw %ax
movw $1, %ax
- call *read_sector
+ call *read_sectors
jc 99f
cmpw $0xaa55, %es:(510)
je 99f
@@ -158,7 +167,7 @@ read_boot_sector:
ret
/*
- * Read single sector to %es:0000 and verify 0x55aa signature
+ * Read sectors to %es:0000
*
* Parameters:
* %dl : BIOS drive number
@@ -171,7 +180,7 @@ read_boot_sector:
* Returns:
* CF set on error
*/
-read_sector: .word read_chs
+read_sectors: .word read_chs
read_chs:
/* Read sectors using C/H/S address */