Changeset 90 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src
- Timestamp:
- Jan 27, 2011, 11:31:31 AM (14 years ago)
- google:author:
- aitotat
- Location:
- trunk/XTIDE_Universal_BIOS/Src
- Files:
-
- 1 added
- 3 deleted
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/XTIDE_Universal_BIOS/Src/Boot/BootVars.asm
r84 r90 1 ; File name : BootVars.asm 2 ; Project name : IDE BIOS 3 ; Created date : 1.4.2010 4 ; Last update : 14.1.2011 5 ; Author : Tomi Tilli, 6 ; : Krister Nordvall (optimizations) 1 ; Project name : XTIDE Universal BIOS 7 2 ; Description : Functions to access BOOTVARS struct. 8 3 … … 77 72 sti ; Enable interrupts 78 73 jmp ax 79 80 81 ;--------------------------------------------------------------------82 ; Backups system INT 18h ROM Boot / Boot Failure handler and83 ; installs our own for boot menu INT 18h callbacks.84 ;85 ; BootVars_StoreSystemInt18hAndInstallOurs86 ; Parameters:87 ; DS: BDA and Interrupt Vector segment (zero)88 ; Returns:89 ; Nothing90 ; Corrupts registers:91 ; AX, BX, ES92 ;--------------------------------------------------------------------93 ALIGN JUMP_ALIGN94 BootVars_StoreSystemInt18hAndInstallOurs:95 mov bx, INTV_BOOT_FAILURE*4 ; Offset to INT 18h vector96 les ax, [bx] ; Load system INT 18h97 mov [BOOTVARS.dwSys18h], ax98 mov [BOOTVARS.dwSys18h+2], es99 mov WORD [bx], Int18h_BootError ; Install our INT 18h100 mov WORD [bx+2], cs101 ret102 103 104 ;--------------------------------------------------------------------105 ; Restores system INT 18h ROM Boot or Boot Error handler.106 ;107 ; BootVars_RestoreSystemInt18h108 ; Parameters:109 ; Nothing110 ; Returns:111 ; Nothing112 ; Corrupts registers:113 ; AX, DS, ES114 ;--------------------------------------------------------------------115 ALIGN JUMP_ALIGN116 BootVars_RestoreSystemInt18h:117 LOAD_BDA_SEGMENT_TO ds, ax118 les ax, [BOOTVARS.dwSys18h]119 mov [INTV_BOOT_FAILURE*4], ax120 mov [INTV_BOOT_FAILURE*4+2], es121 ret -
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h.asm
r84 r90 1 ; File name : Int13h_Jump.asm 2 ; Project name : IDE BIOS 3 ; Created date : 21.9.2007 4 ; Last update : 14.1.2011 5 ; Author : Tomi Tilli, 6 ; : Krister Nordvall (optimizations) 1 ; Project name : XTIDE Universal BIOS 7 2 ; Description : Int 13h BIOS functions (Floppy and Hard disk). 8 3 … … 227 222 dw AH3h_HandlerForWriteDiskSectors ; 03h, Write Disk Sectors (All) 228 223 dw AH4h_HandlerForVerifyDiskSectors ; 04h, Verify Disk Sectors (All) 229 dw AH5h_HandlerForFormatDiskTrack; 05h, Format Disk Track (XT, AT, EISA)224 dw Int13h_UnsupportedFunction ; 05h, Format Disk Track (XT, AT, EISA) 230 225 dw Int13h_UnsupportedFunction ; 06h, Format Disk Track with Bad Sectors (XT) 231 226 dw Int13h_UnsupportedFunction ; 07h, Format Multiple Cylinders (XT) … … 242 237 dw Int13h_UnsupportedFunction ; 12h, Controller RAM Diagnostic (XT) 243 238 dw Int13h_UnsupportedFunction ; 13h, Drive Diagnostic (XT) 244 dw AH14h_HandlerForControllerInternalDiagnostic; 14h, Controller Internal Diagnostic (All)239 dw Int13h_UnsupportedFunction ; 14h, Controller Internal Diagnostic (All) 245 240 dw AH15h_HandlerForReadDiskDriveSize ; 15h, Read Disk Drive Size (AT+) 246 241 dw Int13h_UnsupportedFunction ; 16h, -
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int19h.asm
r84 r90 1 ; File name : Int19h.asm 2 ; Project name : IDE BIOS 3 ; Created date : 3.8.2007 4 ; Last update : 14.1.2011 5 ; Author : Tomi Tilli, 6 ; : Krister Nordvall (optimizations) 1 ; Project name : XTIDE Universal BIOS 7 2 ; Description : Int 19h BIOS functions (Boot Strap Loader). 8 3 … … 12 7 B_READ_RETRY_TIMES EQU 3 ; Number of times to retry 13 8 14 15 ;--------------------------------------------------------------------16 ; Int 19h software interrupt handler for late initialization.17 ; Calls actual Int 19h after initialization is complete.18 ;19 ; Int19h_LateInitialization20 ; Parameters:21 ; Nothing22 ; Returns:23 ; Never returns24 ;--------------------------------------------------------------------25 ALIGN JUMP_ALIGN26 Int19h_LateInitialization:27 call Initialize_ShouldSkip ; Skip initialization?28 jc SHORT .SkipInitialization29 call Initialize_AndDetectDrives30 int INTV_BOOTSTRAP ; Call actual boot loader31 .SkipInitialization:32 call RamVars_Initialize ; RAMVARS must be initialized even for simple boot loader33 ; Fall to Int19h_SimpleBootLoader34 35 ;--------------------------------------------------------------------36 ; Simple boot loader.37 ; Boot sequence is fixed to 00h, 80h and INT 18h.38 ;39 ; Int19h_SimpleBootLoader40 ; Parameters:41 ; Nothing42 ; Returns:43 ; Never returns44 ;--------------------------------------------------------------------45 ALIGN JUMP_ALIGN46 Int19h_SimpleBootLoader:47 sti ; Enable interrupts48 call RamVars_GetSegmentToDS49 xor dx, dx50 call Int19h_TryToLoadBootSectorFromDL51 jc SHORT Int19h_JumpToBootSector52 mov dl, 80h53 call Int19h_TryToLoadBootSectorFromDL54 jc SHORT Int19h_JumpToBootSector55 call Int19h_BootFailure ; Should never return56 jmp SHORT Int19h_SimpleBootLoader57 9 58 10 ;-------------------------------------------------------------------- -
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int19hMenu.asm
r3 r90 1 ; File name : Int19hMenu.asm 2 ; Project name : IDE BIOS 3 ; Created date : 25.3.2010 4 ; Last update : 12.4.2010 5 ; Author : Tomi Tilli 1 ; Project name : XTIDE Universal BIOS 6 2 ; Description : Int 19h BIOS functions for Boot Menu. 7 3 … … 24 20 LOAD_BDA_SEGMENT_TO ds, ax 25 21 call BootVars_StorePostStackPointer 26 call BootVars_StoreSystemInt18hAndInstallOurs27 22 28 23 ; Install new INT 19h handler now that BOOTVARS has been initialized … … 111 106 ALIGN JUMP_ALIGN 112 107 .Int18hRomBoot: 113 call BootVars_RestoreSystemInt18h114 108 call BootVars_SwitchBackToPostStack 115 call Int19h_BootFailure ; Should never return 116 jmp SHORT Int19hMenu_BootLoader ; Status unknown so reinitialize boot loader 109 jmp Int19h_BootFailure ; Never returns -
trunk/XTIDE_Universal_BIOS/Src/Initialization/Initialize.asm
r33 r90 1 ; File name : Initialize.asm 2 ; Project name : IDE BIOS 3 ; Created date : 23.3.2010 4 ; Last update : 23.8.2010 5 ; Author : Tomi Tilli 1 ; Project name : XTIDE Universal BIOS 6 2 ; Description : Functions for initializing the BIOS. 7 3 … … 28 24 ePUSHA 29 25 26 LOAD_BDA_SEGMENT_TO es, ax 30 27 call Initialize_ShouldSkip 31 j c SHORT .ReturnFromRomInit28 jnz SHORT .SkipRomInitialization 32 29 33 ePUSH_T ax, .ReturnFromRomInit ; Push return address 34 test BYTE [cs:ROMVARS.wFlags], FLG_ROMVARS_LATE 35 jnz SHORT Initialize_PrepareLateInitialization 36 jmp SHORT Initialize_AndDetectDrives 37 38 ALIGN JUMP_ALIGN 39 .ReturnFromRomInit: 30 %ifdef USE_AT ; Early initialization on AT build 31 call Initialize_AndDetectDrives 32 %else ; Late initialization on XT builds 33 call Int19hLate_InitializeInt19h 34 %endif 35 .SkipRomInitialization: 40 36 ePOPA 41 37 pop ds … … 50 46 ; Initialize_ShouldSkip 51 47 ; Parameters: 48 ; ES: BDA segment 49 ; Returns: 50 ; ZF: Cleared if ROM initialization is to be skipped 51 ; Set to continue ROM initialization 52 ; Corrupts registers: 52 53 ; Nothing 53 ; Returns:54 ; CF: Set if ROM initialization is to be skipped55 ; Cleared to continue ROM initialization56 ; Corrupts registers:57 ; AX, DS58 54 ;-------------------------------------------------------------------- 59 55 ALIGN JUMP_ALIGN 60 56 Initialize_ShouldSkip: 61 sti ; Enable interrupts 62 LOAD_BDA_SEGMENT_TO ds, ax 63 mov al, [BDA.bKBFlgs1] ; Load shift flags 64 eSHR_IM al, 3 ; Set CF if CTRL is held down 57 sti ; Enable interrupts 58 test BYTE [es:BDA.bKBFlgs1], (1<<2) ; Clear ZF if CTRL is held down 65 59 ret 66 67 68 ;--------------------------------------------------------------------69 ; Installs INT 19h boot loader handler for late initialization.70 ;71 ; Initialize_PrepareLateInitialization72 ; Parameters:73 ; Nothing74 ; Returns:75 ; Nothing76 ; Corrupts registers:77 ; BX, SI, ES78 ;--------------------------------------------------------------------79 ALIGN JUMP_ALIGN80 Initialize_PrepareLateInitialization:81 LOAD_BDA_SEGMENT_TO es, bx82 mov bl, INTV_BOOTSTRAP83 mov si, Int19h_LateInitialization84 jmp Interrupts_InstallHandlerToVectorInBXFromCSSI85 60 86 61 … … 90 65 ; Initialize_AndDetectDrives 91 66 ; Parameters: 92 ; Nothing67 ; ES: BDA Segment 93 68 ; Returns: 94 69 ; Nothing … … 101 76 call RamVars_Initialize 102 77 call RamVars_GetSegmentToDS 103 LOAD_BDA_SEGMENT_TO es, ax104 78 call Interrupts_InitializeInterruptVectors 105 79 call DetectDrives_FromAllIDEControllers -
trunk/XTIDE_Universal_BIOS/Src/Initialization/Interrupts.asm
r86 r90 1 ; Project name : IDEBIOS1 ; Project name : XTIDE Universal BIOS 2 2 ; Description : Functions for initializing the BIOS. 3 3 … … 66 66 ALIGN JUMP_ALIGN 67 67 Interrupts_InitializeInt19h: 68 eMOVZX bx, [cs:ROMVARS.bBootLdrType] ; Load boot loader type 69 mov si, INTV_BOOTSTRAP ; 19h 70 xchg bx, si ; SI=Loader type, BX=19h 71 jmp [cs:si+.rgwSetupBootLoader] ; Jump to install selected loader 72 ALIGN WORD_ALIGN 73 .rgwSetupBootLoader: 74 dw .SetupBootMenuLoader ; BOOTLOADER_TYPE_MENU 75 dw .SetupSimpleLoader ; BOOTLOADER_TYPE_SIMPLE 76 dw .SetupBootMenuLoader ; reserved 77 dw .NoBootLoader ; BOOTLOADER_TYPE_NONE 78 79 ALIGN JUMP_ALIGN 80 .NoBootLoader: 81 test BYTE [cs:ROMVARS.wFlags], FLG_ROMVARS_LATE 82 jnz SHORT .SetupSimpleLoader ; Boot loader required for late initialization 83 ret 84 ALIGN JUMP_ALIGN 85 .SetupSimpleLoader: 86 mov si, Int19h_SimpleBootLoader 87 jmp Interrupts_InstallHandlerToVectorInBXFromCSSI 88 ALIGN JUMP_ALIGN 89 .SetupBootMenuLoader: 68 mov bx, INTV_BOOTSTRAP 90 69 mov si, Int19hMenu_BootLoader 91 70 jmp Interrupts_InstallHandlerToVectorInBXFromCSSI -
trunk/XTIDE_Universal_BIOS/Src/Main.asm
r88 r90 38 38 at ROMVARS.bRomSize, db CNT_ROM_BLOCKS ; ROM size in 512B blocks 39 39 at ROMVARS.rgbJump, jmp Initialize_FromMainBiosRomSearch 40 at ROMVARS.rgbDate, db "01/27/11" ; Build data (mm/dd/yy)41 40 at ROMVARS.rgbSign, db "XTIDE120" ; Signature for flash program 42 41 at ROMVARS.szTitle … … 49 48 db " (XT)=-",NULL 50 49 %endif 51 at ROMVARS.szVersion, db "v1.2.0_wip (01/27/11)",NULL 50 at ROMVARS.szVersion, db "v1.2.0_wip (01/27/11)",NULL ; mm/dd/yy 52 51 53 52 ;---------------------------; … … 55 54 ;---------------------------; 56 55 %ifdef USE_AT 57 at ROMVARS.wFlags, dw FLG_ROMVARS_FULLMODE | FLG_ROMVARS_DRVXLAT | FLG_ROMVARS_ DRVNFO | FLG_ROMVARS_MAXSIZE56 at ROMVARS.wFlags, dw FLG_ROMVARS_FULLMODE | FLG_ROMVARS_DRVXLAT | FLG_ROMVARS_MAXSIZE 58 57 at ROMVARS.bIdeCnt, db 3 ; Number of supported controllers 59 58 at ROMVARS.bBootDrv, db 80h ; Boot Menu default drive 60 59 at ROMVARS.bBootDelay, db 30 ; Boot Menu selection delay (secs) 61 at ROMVARS.bBootLdrType, db BOOTLOADER_TYPE_MENU ; Boot loader type62 60 at ROMVARS.bMinFddCnt, db 0 ; Do not force minimum number of floppy drives 63 61 at ROMVARS.bStealSize, db 1 ; Steal 1kB from base memory … … 87 85 ; XT and XT+ Build default settings ; 88 86 ;-----------------------------------; 89 at ROMVARS.wFlags, dw FLG_ROMVARS_ LATE | FLG_ROMVARS_DRVXLAT | FLG_ROMVARS_ROMBOOT | FLG_ROMVARS_DRVNFO| FLG_ROMVARS_MAXSIZE87 at ROMVARS.wFlags, dw FLG_ROMVARS_DRVXLAT | FLG_ROMVARS_ROMBOOT | FLG_ROMVARS_MAXSIZE 90 88 at ROMVARS.bIdeCnt, db 1 ; Number of supported controllers 91 89 at ROMVARS.bBootDrv, db 80h ; Boot Menu default drive 92 90 at ROMVARS.bBootDelay, db 30 ; Boot Menu selection delay (secs) 93 at ROMVARS.bBootLdrType, db BOOTLOADER_TYPE_MENU ; Boot loader type94 91 at ROMVARS.bMinFddCnt, db 1 ; Assume at least 1 floppy drive present if autodetect fails 95 92 at ROMVARS.bStealSize, db 1 ; Steal 1kB from base memory in full mode … … 143 140 ; Include .asm files (Interrupt handlers) 144 141 %include "Int13h.asm" ; For Int 13h, Disk functions 145 %include "Int18h.asm" ; For Int 18h, ROM Boot and Boot error146 142 %include "Int19h.asm" ; For Int 19h, Boot Loader 143 %ifndef USE_AT 144 %include "Int19hLate.asm" ; For late initialization 145 %endif 147 146 %include "Int19hMenu.asm" ; For Int 19h, Boot Loader for Boot Menu 148 147 %include "BootPrint.asm" ; For printing boot information … … 154 153 %include "AH3h_HWrite.asm" ; Required by Int13h_Jump.asm 155 154 %include "AH4h_HVerify.asm" ; Required by Int13h_Jump.asm 156 %include "AH5h_HFormat.asm" ; Required by Int13h_Jump.asm157 155 %include "AH8h_HParams.asm" ; Required by Int13h_Jump.asm 158 156 %include "AH9h_HInit.asm" ; Required by Int13h_Jump.asm … … 161 159 %include "AH10h_HReady.asm" ; Required by Int13h_Jump.asm 162 160 %include "AH11h_HRecal.asm" ; Required by Int13h_Jump.asm 163 %include "AH14h_HDiag.asm" ; Required by Int13h_Jump.asm164 161 %include "AH15h_HSize.asm" ; Required by Int13h_Jump.asm 165 162 %include "AH23h_HFeatures.asm" ; Required by Int13h_Jump.asm -
trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/RamVars.asm
r33 r90 1 ; File name : RamVars.asm 2 ; Project name : IDE BIOS 3 ; Created date : 14.3.2010 4 ; Last update : 23.8.2010 5 ; Author : Tomi Tilli 1 ; Project name : XTIDE Universal BIOS 6 2 ; Description : Functions for accessings RAMVARS. 7 3 … … 19 15 ; Nothing 20 16 ; Corrupts registers: 21 ; AX, CX, DI, DS , ES17 ; AX, CX, DI, DS 22 18 ;-------------------------------------------------------------------- 23 19 ALIGN JUMP_ALIGN 24 20 RamVars_Initialize: 21 push es 25 22 call .StealMemoryForRAMVARS ; Get RAMVARS segment to DS even if no stealing 26 23 call .ClearRamvarsFromDS 24 pop es 27 25 jmp DriveXlate_Reset 28 26
Note:
See TracChangeset
for help on using the changeset viewer.