163 |
/* check if AH=0x42 is supported if FORCE_LBA is zero */ |
/* check if AH=0x42 is supported if FORCE_LBA is zero */ |
164 |
MOV_MEM_TO_AL(ABS(force_lba)) /* movb ABS(force_lba), %al */ |
MOV_MEM_TO_AL(ABS(force_lba)) /* movb ABS(force_lba), %al */ |
165 |
testb %al, %al |
testb %al, %al |
166 |
jnz skip_lba_bitmap_check |
jnz lba_mode |
167 |
andw $1, %cx |
andw $1, %cx |
168 |
jz chs_mode |
jz chs_mode |
169 |
|
|
|
skip_lba_bitmap_check: |
|
|
|
|
|
/* get the geometry (limited to 2TB!) */ |
|
|
movb $0x48, %ah |
|
|
movw $STAGE1_DRP_ADDR, %si |
|
|
movw $STAGE1_DRP_SIZE, (%si) |
|
|
int $0x13 |
|
|
|
|
|
/* use CHS if fails */ |
|
|
jc chs_mode |
|
|
|
|
170 |
lba_mode: |
lba_mode: |
171 |
/* save the total number of sectors */ |
/* save the total number of sectors */ |
172 |
movl 0x10(%si), %ecx |
movl 0x10(%si), %ecx |
179 |
|
|
180 |
movl ABS(stage2_sector), %ebx |
movl ABS(stage2_sector), %ebx |
181 |
|
|
|
/* check for the geometry */ |
|
|
#ifdef NO_BUGGY_BIOS_IN_THE_WORLD |
|
|
cmpl %ecx, %ebx |
|
|
jge geometry_error |
|
|
#endif /* NO_BUGGY_BIOS_IN_THE_WORLD */ |
|
|
|
|
182 |
/* the size and the reserved byte */ |
/* the size and the reserved byte */ |
183 |
movw $0x0010, (%si) |
movw $0x0010, (%si) |
184 |
|
|