Changeset 105


Ignore:
Timestamp:
Apr 8, 2017, 12:27:02 AM (8 years ago)
Author:
Ben Rietbroek
Message:

Moved the INT13X DAP to the BSS [v1.1.1-testing]

No need to have this in the image, eating up precious code-space.
The byte holding the packet size is now initialized from PRERAP.

CAUTION:
This is a testbuild !
AirBoot uses the BIOS to access disks and a small coding error can trash
partition tables or other vital disk structures. You are advised to make
backups of TRACK0 and EBRs before using this testbuild. More info at:
https://rousseaux.github.io/netlabs.air-boot/pdf/AirBoot-v1.1.0-manual.pdf

Location:
trunk/bootcode
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/bootcode/airboot.asm

    r97 r105  
    23512351
    23522352; -----------------------------------------------------------------------------
    2353 ;                                                                  I13X BUFFER
    2354 ; -----------------------------------------------------------------------------
     2353;                                                                   INT13X DAP
     2354; -----------------------------------------------------------------------------
     2355
     2356; Disk Address Package that holds information for LBA-access using INT13X
     2357INT13X_DAP                  db      ?       ; Size of paket, inserted by code
     2358                            db      ?       ; Reserved
     2359INT13X_DAP_NumBlocks        dw      ?       ; Number of blocks
     2360INT13X_DAP_Transfer         dd      ?       ; Transfer Adress
     2361INT13X_DAP_Absolute         dd      ?       ; Absolute Sector
     2362                            dd      ?       ; Second Part of QWORD
     2363INT13X_DAP_Size = $-offset [INT13X_DAP]     ; Calculated size
     2364
    23552365;
    23562366; BOOKMARK: Temporary buffer for 48h INT13X bios call.
  • trunk/bootcode/regular/driveio.asm

    r104 r105  
    436436DriveIO_SaveLVMSector   EndP
    437437
    438 ; Rousseau: Move this to BSS and merge with int13xbuf there.
    439 
    440 ; Memory-Block that holds information for LBA-access via INT 13h
    441 DriveIO_DAP                 db      10h ; Size of paket
    442                             db      0   ; Reserved
    443 DriveIO_DAP_NumBlocks       dw      0   ; Number of blocks
    444 DriveIO_DAP_Transfer        dd      0   ; Transfer Adress
    445 DriveIO_DAP_Absolute        dd      0   ; Absolute Sector
    446                             dd      0   ; Second Part of QWORD
     438
    447439
    448440; Special error message instead of "LOAD ERROR" during partition scanning,
     
    517509    DIOLS_UseExtension:
    518510        push    cx
    519         mov     cs:[DriveIO_DAP_NumBlocks], 1         ; Copy ONE sector
    520         mov     wptr cs:[DriveIO_DAP_Transfer+0], si
     511        mov     cs:[INT13X_DAP_NumBlocks], 1         ; Copy ONE sector
     512        mov     wptr cs:[INT13X_DAP_Transfer+0], si
    521513        mov     cx, ds
    522         mov     wptr cs:[DriveIO_DAP_Transfer+2], cx ; Fill out Transfer Adress
    523         mov     wptr cs:[DriveIO_DAP_Absolute+0], ax
    524         mov     wptr cs:[DriveIO_DAP_Absolute+2], bx ; Fill out Absolute Sector
     514        mov     wptr cs:[INT13X_DAP_Transfer+2], cx ; Fill out Transfer Adress
     515        mov     wptr cs:[INT13X_DAP_Absolute+0], ax
     516        mov     wptr cs:[INT13X_DAP_Absolute+2], bx ; Fill out Absolute Sector
    525517        push    cs
    526518        pop     ds
    527         mov     si, offset DriveIO_DAP
    528         mov     ah, 42h                        ; Extended Read
     519        mov     si, offset [INT13X_DAP]
     520        mov     ah, 42h                              ; Extended Read
    529521        int     13h
    530522        pop     cx
     
    552544
    553545        ; One sector to read
    554         mov     cs:[DriveIO_DAP_NumBlocks], 1
     546        mov     cs:[INT13X_DAP_NumBlocks], 1
    555547
    556548        ; Setup transfer address
    557         mov     wptr cs:[DriveIO_DAP_Transfer+0], si    ; offset
    558         mov     wptr cs:[DriveIO_DAP_Transfer+2], di    ; segment
     549        mov     wptr cs:[INT13X_DAP_Transfer+0], si     ; offset
     550        mov     wptr cs:[INT13X_DAP_Transfer+2], di     ; segment
    559551
    560552        ; Setup LBA64 address of requested sector
    561         mov     wptr cs:[DriveIO_DAP_Absolute+0], cx    ; low word lower part
    562         mov     wptr cs:[DriveIO_DAP_Absolute+2], bx    ; high word lower part
    563         mov     wptr cs:[DriveIO_DAP_Absolute+4], 0     ; low word upper part
    564         mov     wptr cs:[DriveIO_DAP_Absolute+6], 0     ; high word upper part
     553        mov     wptr cs:[INT13X_DAP_Absolute+0], cx     ; low word lower part
     554        mov     wptr cs:[INT13X_DAP_Absolute+2], bx     ; high word lower part
     555        mov     wptr cs:[INT13X_DAP_Absolute+4], 0      ; low word upper part
     556        mov     wptr cs:[INT13X_DAP_Absolute+6], 0      ; high word upper part
    565557
    566558        ; Address of packet
    567         mov     si, offset [DriveIO_DAP]                ; disk address packet
     559        mov     si, offset [INT13X_DAP]                 ; disk address packet
    568560
    569561        ; Do the extended read
     
    606598
    607599        ; One sector to read
    608         mov     cs:[DriveIO_DAP_NumBlocks], 1
     600        mov     cs:[INT13X_DAP_NumBlocks], 1
    609601
    610602        ; Setup transfer address
    611         mov     wptr cs:[DriveIO_DAP_Transfer+0], si    ; offset
    612         mov     wptr cs:[DriveIO_DAP_Transfer+2], di    ; segment
     603        mov     wptr cs:[INT13X_DAP_Transfer+0], si     ; offset
     604        mov     wptr cs:[INT13X_DAP_Transfer+2], di     ; segment
    613605
    614606        ; Setup LBA64 address of requested sector
    615         mov     wptr cs:[DriveIO_DAP_Absolute+0], cx    ; low word lower part
    616         mov     wptr cs:[DriveIO_DAP_Absolute+2], bx    ; high word lower part
    617         mov     wptr cs:[DriveIO_DAP_Absolute+4], 0     ; low word upper part
    618         mov     wptr cs:[DriveIO_DAP_Absolute+6], 0     ; high word upper part
     607        mov     wptr cs:[INT13X_DAP_Absolute+0], cx     ; low word lower part
     608        mov     wptr cs:[INT13X_DAP_Absolute+2], bx     ; high word lower part
     609        mov     wptr cs:[INT13X_DAP_Absolute+4], 0      ; low word upper part
     610        mov     wptr cs:[INT13X_DAP_Absolute+6], 0      ; high word upper part
    619611
    620612        ; Address of packet
    621         mov     si, offset [DriveIO_DAP]                ; disk address packet
     613        mov     si, offset [INT13X_DAP]                 ; disk address packet
    622614
    623615        ; Do the extended write
     
    916908    DIOSS_UseExtension:
    917909        push    cx
    918         mov     cs:[DriveIO_DAP_NumBlocks], 1        ; Copy ONE sector
    919         mov     wptr cs:[DriveIO_DAP_Transfer+0], si
     910        mov     cs:[INT13X_DAP_NumBlocks], 1         ; Copy ONE sector
     911        mov     wptr cs:[INT13X_DAP_Transfer+0], si
    920912        mov     cx, ds
    921         mov     wptr cs:[DriveIO_DAP_Transfer+2], cx ; Fill out Transfer Adress
    922         mov     wptr cs:[DriveIO_DAP_Absolute+0], ax
    923         mov     wptr cs:[DriveIO_DAP_Absolute+2], bx ; Fill out Absolute Sector
     913        mov     wptr cs:[INT13X_DAP_Transfer+2], cx ; Fill out Transfer Adress
     914        mov     wptr cs:[INT13X_DAP_Absolute+0], ax
     915        mov     wptr cs:[INT13X_DAP_Absolute+2], bx ; Fill out Absolute Sector
    924916        push    cs
    925917        pop     ds
    926         mov     si, offset DriveIO_DAP
    927         mov     ax, 4300h                  ; Extended Write (No Verify)
     918        mov     si, offset [INT13X_DAP]
     919        mov     ax, 4300h                            ; Extended Write (No Verify)
    928920        int     13h
    929921        pop     cx
     
    981973    DriveIO_LoadMasterLVMSector_NextTry:
    982974        ; Number of sectors to read
    983         mov     [DriveIO_DAP_NumBlocks],1
     975        mov     [INT13X_DAP_NumBlocks],1
    984976
    985977        ; Setup destination address
    986978        mov     si, offset [LVMSector]
    987         mov     word ptr [DriveIO_DAP_Transfer+0],si
     979        mov     word ptr [INT13X_DAP_Transfer+0],si
    988980        mov     ax, ds
    989         mov     word ptr [DriveIO_DAP_Transfer+2],ax
     981        mov     word ptr [INT13X_DAP_Transfer+2],ax
    990982
    991983        ; Get the sector-number of the next possible LVM sector (255,127,63)
     
    10201012
    10211013        ; Setup the requested LBA sector number
    1022         mov     word ptr [DriveIO_DAP_Absolute+0],ax    ; LBA low                   NORMAL I/O GEBRUIKEN !
    1023         mov     word ptr [DriveIO_DAP_Absolute+2],00h   ; LBA high
    1024         mov     si, offset DriveIO_DAP                  ; address request packet
     1014        mov     word ptr [INT13X_DAP_Absolute+0],ax    ; LBA low                   NORMAL I/O GEBRUIKEN !
     1015        mov     word ptr [INT13X_DAP_Absolute+2],00h   ; LBA high
     1016        mov     si, offset [INT13X_DAP]                ; address request packet
    10251017        mov     ah, 42h
    1026         int     13h                                     ; do the i/o
     1018        int     13h                                    ; do the i/o, CF=1->error, CF=0->success
     1019
     1020IFDEF   AUX_DEBUG
     1021                pushf
     1022                pusha
     1023                pushf
     1024                xor     ax, ax
     1025                mov     al, dl
     1026                call    AuxIO_TeletypeHexWord
     1027                mov     al, '#'
     1028                call    AuxIO_Teletype
     1029                popf
     1030                mov     ax,0000h
     1031                rcl     al, 1
     1032                call    AuxIO_TeletypeHexWord
     1033                mov     al, '#'
     1034                call    AuxIO_Teletype
     1035                mov     ax,word ptr [INT13X_DAP_Absolute+0]
     1036                call    AuxIO_TeletypeHexWord
     1037                mov     al, '#'
     1038                call    AuxIO_Teletype
     1039                popa
     1040                popf
     1041ENDIF
     1042
    10271043        cmc     ; Complement carry so we can exit imm. on error
    10281044        jnc     DriveIO_LoadMasterLVMSector_End  ; oops, return with NC
     
    10571073    DriveIO_LoadMasterLVMSector_Found:
    10581074        ; Store the address for later use.
    1059         mov     ax, word ptr [DriveIO_DAP_Absolute]
     1075        mov     ax, word ptr [INT13X_DAP_Absolute]
    10601076        mov     word ptr [MasterLVMLBA], ax
    10611077
  • trunk/bootcode/regular/other.asm

    r101 r105  
    8989;
    9090PRECRAP_Main    Proc Near
     91
    9192        ; First initialize Variable-Area (everything with NUL)
    9293        ; We use the start instead of the variables because they could be 'orged'
     
    371372
    372373        ;
     374        ; Setup the size of the INT13X Disk Address Packet
     375        ;
     376        mov     [INT13X_DAP], INT13X_DAP_Size
     377
     378        ;
    373379        ; Check valididy of the AiR-BOOT Configuration.
    374380        ;
Note: See TracChangeset for help on using the changeset viewer.