boot odds and ends. unfinished cd-detection work.

This commit is contained in:
Ben Gras
2005-05-03 08:52:41 +00:00
parent 544b225a44
commit ccd06c407c
4 changed files with 1676 additions and 2 deletions

View File

@@ -1204,6 +1204,44 @@ bcd: movb ah, al
.data1 0xD5,10 ! aad ! ax = (al >> 4) * 10 + (al & 0x0F)
ret ! (BUG: assembler messes up aad & aam!)
! void bootcdinfo(u32_t bufaddr, int *ret, int drive)
! If booted from CD, do BIOS int 0x13 call to obtain boot CD device.
.define _bootcdinfo
_bootcdinfo:
push bp
mov bp, sp
push ax
push bx
push cx
push dx
push si
push ds
mov bx, 10(bp) ! drive number
mov cx, 8(bp)
mov ax, 4(bp) ! buffer address from stack
mov dx, 6(bp)
call abs2seg
mov si, ax ! bios will put data in ds:si
mov ds, dx
! movb dl, #0x00
movb dh, #0x00
movb dl, bl
! mov ax, #0x4b01 ! command 0x4b, subcommand 0x01
movb ah, #0x4b
movb al, bh
int 0x13
mov bp, cx
mov (bp), ax
pop ds
pop si
pop dx
pop cx
pop bx
pop ax
pop bp
ret
! Support function for Minix-386 to make a BIOS int 13 call (disk I/O).
bios13:
mov bp, sp