flat assembler
Message board for the users of flat assembler.
Index
> OS Construction > Need help with code |
Author |
|
roboman 30 Mar 2011, 10:01
>AH = 42h
>DL = drive number >DS:SI -> disk address packet So you have FFh as your drive number.... and I'm guessing the >mov di, DAP should have been: mov si, DAP >00h BYTE size of packet (10h or 18h) >01h BYTE reserved (0) >02h WORD number of blocks to transfer (max 007Fh for Phoenix EDD) >04h DWORD -> transfer buffer >08h QWORD starting absolute block number (for non-LBA devices, compute as (Cylinder*NumHeads + SelectedHead) * SectorPerTrack + SelectedSector - 1 >10h QWORD (EDD-3.0, optional) 64-bit flat address of transfer buffer; used if DWORD at 04h is FFFFh:FFFFh DAP_Size db 10h DAP_Res1 db 0 DAP_Bytes2Transfer db 4h DAP_Res2 db 0 DAP_Buff_Addr dd 08100000h DAP_LBA dq 0h Um, the sizes don't match. Comments as to what you are trying to do might help. Guessing that's a boot sector and you are taking a shot at loading something, from some drive, to some where, but am a bit lost as to exactly what you are shooting for. |
|||
30 Mar 2011, 10:01 |
|
BOTOKILLER 30 Mar 2011, 10:27
code comments - done(much of old useless code, which is now no needed there)
about DAP - http://www.t13.org/Documents/UploadedDocuments/project/d1386r5-EDD.pdf - these are specs, page 9 - I filled it accordingly to this table any other ideas??? |
|||
30 Mar 2011, 10:27 |
|
roboman 31 Mar 2011, 03:31
>AH - 42h
>DL - BIOS device number >DS:SI - Device address packet That part agrees with Ralf Brown's Interrupt List. So you are starting at the highest possible device and just working your way down, trying to load the boot sector mov ds, di ; loading DAP segment mov di, DAP ; and offset oopps, the offset should have been put in si. Don't see si in the program, so it's a guess as to what chunk of memory it's reading as a DAP table. So the software just starts with the last possible device and counts down loading any thing found in the first 4 sectors into the same location it did with the last device, then goes into an endless loop? Or 400h sectors get copied, depending on whos docs are right. Hoping to see each drives lights come on as a test? Don't know why the error message, I checked several bois that I have on the computers around here and some don't have the extended functions, so I don't use them... |
|||
31 Mar 2011, 03:31 |
|
BOTOKILLER 31 Mar 2011, 12:25
roboman wrote: >AH - 42h thanks, the error message is gone, but nothing more, I look into memory through debugger, but nothing on 810h:0000h VirtualBox wrote:
about 400h sectors, I think, that I fixed it too Code: USE16 ORG 07C00h START: mov ecx, 0FFh LOADKERN: mov di, DAP_Buff_Addr mov dword [cs:di], 8100000h ; that is where i fixed it mov dl, cl mov si, cs ; changed di to si mov ds, si mov si, DAP mov ah, 42h pusha int 13h push ax push dx mov al, '2' jnc FAIL pop ax pop dx AFTERFAIL: popa loop LOADKERN ; AMOUNTOFMEMSCAN: ; mov ax, 0E801h ; int 15h ; mov al, '1' ; jc FAIL ; xchg ax, bx ; mov bx, 0FFFFh ; mul bx ;mov di, MAXMEMADDR ;mov [cs:di], eax LDSO: jmp LDSO FAIL: mov ah, 0eh int 10h pop ax push ax xchg ah, al mov ah, 0eh int 10h pop ax pop dx jmp LDSO DAP: DAP_Size db 10h DAP_Res1 db 0 DAP_Bytes2Transfer db 4h DAP_Res2 db 0 DAP_Buff_Addr dd 08100000h DAP_LBA dq 0h times 12 db 0 ;MAXMEMADDR dd 0 times 1958 db 0 dw 0AA55h i doubt that it reads CD even once, or I just have mor mistakes in my code???? |
|||
31 Mar 2011, 12:25 |
|
Dex4u 31 Mar 2011, 16:03
Have you tryed something like this
Code: DAP_Size db 10h DAP_Res1 db 0 DAP_Bytes2Transfer db 4h DAP_Res2 db 0 DAP_Buff_Addr1 dw 0x0810 DAP_Buff_Addr2 dw 0 DAP_LBA dq 0 As if i can remember right some of the info on the net about DAP layout is wrong. |
|||
31 Mar 2011, 16:03 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.