/kernel/trunk/blkdev/bd_drv.inc |
---|
31,6 → 31,14 |
int13_regs_out rb sizeof.v86_regs |
cache_chain_size db ? |
endg |
struct BiosDiskData |
DriveNumber db ? |
IRQ db ? |
ATADEVbit dw ? |
SectorSize dd ? |
Capacity dq ? |
ends |
;----------------------------------------------------------------- |
proc bd_read_interface stdcall uses edi, \ |
userdata, buffer, startsector:qword, numsectors |
152,13 → 160,18 |
ret |
endp |
;----------------------------------------------------------------- |
; This is a stub. |
proc bd_querymedia stdcall, hd_data, mediainfo |
mov eax, [mediainfo] |
mov [eax+DISKMEDIAINFO.Flags], 0 |
mov [eax+DISKMEDIAINFO.SectorSize], 512 |
or dword [eax+DISKMEDIAINFO.Capacity], 0xFFFFFFFF |
or dword [eax+DISKMEDIAINFO.Capacity+4], 0xFFFFFFFF |
mov edx, [mediainfo] |
mov eax, [hd_data] |
lea eax, [(eax-80h)*4] |
lea eax, [BiosDisksData+eax*4] |
mov [edx+DISKMEDIAINFO.Flags], 0 |
mov ecx, [eax+BiosDiskData.SectorSize] |
mov [edx+DISKMEDIAINFO.SectorSize], ecx |
mov ecx, dword [eax+BiosDiskData.Capacity+0] |
mov eax, dword [eax+BiosDiskData.Capacity+4] |
mov dword [edx+DISKMEDIAINFO.Capacity+0], ecx |
mov dword [edx+DISKMEDIAINFO.Capacity+4], eax |
xor eax, eax |
ret |
endp |
253,7 → 266,8 |
rep stosd |
mov byte [ebx+v86_regs.eax+1], dl |
mov eax, [hdpos] |
lea eax, [BiosDisksData+(eax-80h)*4] |
lea eax, [(eax-80h)*4] |
lea eax, [BiosDisksData+eax*4] |
mov dl, [eax] |
mov byte [ebx+v86_regs.edx], dl |
movzx edx, byte [eax+1] |
/kernel/trunk/data32.inc |
---|
454,7 → 454,7 |
pci_access_enabled dd ? ; 0 = disabled , 1 = enabled |
NumBiosDisks dd ? |
BiosDisksData rb 200h |
BiosDisksData rb 200h ; struct BiosDiskData |
BiosDiskCaches rb 80h*(cache_ide1-cache_ide0) |
BiosDiskPartitions rd 80h |
/kernel/trunk/detect/biosdisk.inc |
---|
11,6 → 11,7 |
; Detect all BIOS hard drives. |
; diamond, 2008 |
; Do not include USB mass storages. CleverMouse, 2013 |
; Read the number of sectors, bytes per sector. dunkaist, 2017 |
xor cx, cx |
mov es, cx |
65,6 → 66,7 |
mov al, dl |
stosb |
push ds |
push si |
lds si, [es:si+1Ah] |
mov al, [si+6] |
and al, 0xF |
82,8 → 84,9 |
; mov ax, -1 |
@@: |
stosw |
pop si |
pop ds |
jmp bddc2 |
jmp bddc3 |
.noide: |
cmp word [es:si], 42h |
jb .nousb |
103,6 → 106,13 |
; stosb |
; mov ax, -1 |
; stosw |
bddc3: |
movzx eax, word[es:si+24] |
stosd |
mov eax, [es:si+16] |
stosd |
mov eax, [es:si+20] |
stosd |
bddc2: |
cmp cl, [es:0x475] |
jae bdde |
/kernel/trunk/detect/sear_par.inc |
---|
216,7 → 216,8 |
push 'bd' |
.bdloop: |
; 3b. Get the drive number for using in /bd* name. |
movzx eax, byte [BiosDisksData+esi*4] |
lea eax, [esi*4] |
movzx eax, [BiosDisksData+eax*4+BiosDiskData.DriveNumber] |
sub al, 80h |
; 3c. Convert eax to decimal and store starting with [esp+3]. |
; First 2 bytes in [esp] are "bd". |
/kernel/trunk/kernel.asm |
---|
451,6 → 451,7 |
movzx ecx, byte [esi-1] |
mov [NumBiosDisks], ecx |
mov edi, BiosDisksData |
shl ecx, 2 |
rep movsd |
; -------- Fast System Call init ---------- |