rdos/kernel/bpb.asm

32 lines
355 B
NASM
Raw Normal View History

2019-09-29 23:25:29 +02:00
; IN DL drive number
; BP ptr to bpb_size'd buffer
bpb_load:
2019-09-29 23:33:28 +02:00
push ax
push dx
2019-09-29 23:25:29 +02:00
mov [bp+(bpb_size-1)], dl
2019-09-29 23:33:28 +02:00
; load first sector
2019-09-29 23:25:29 +02:00
xor dx, dx
xor ax, ax
call drive_read
2019-09-29 23:33:28 +02:00
push cx
push si
push di
; copy BPB to BP
2019-09-29 23:25:29 +02:00
mov si, (diskbuf+0x0B)
mov di, bp
mov cx, (bpb_size-1)
rep movsb
2019-09-29 23:33:28 +02:00
pop di
pop si
pop cx
pop dx
pop ax
2019-09-29 23:25:29 +02:00
ret