source: xtideuniversalbios/trunk/XTIDE_Universal_BIOS/Src/Initialization/Initialize.asm@ 357

Last change on this file since 357 was 271, checked in by aitotat@…, 13 years ago

Changes to XTIDE Universal BIOS:

  • AH=0h (Reset) should now work but our drives are no longer reset if DL belongs to foreign drive.
File size: 2.8 KB
RevLine 
[90]1; Project name : XTIDE Universal BIOS
[3]2; Description : Functions for initializing the BIOS.
3
4; Section containing code
5SECTION .text
6
7;--------------------------------------------------------------------
8; Initializes the BIOS.
9; This function is called from main BIOS ROM search routine.
10;
11; Initialize_FromMainBiosRomSearch
12; Parameters:
13; Nothing
14; Returns:
15; Nothing
16; Corrupts registers:
17; Nothing
18;--------------------------------------------------------------------
[229]19Initialize_FromMainBiosRomSearch: ; unused entrypoint ok
[3]20 pushf
21 push es
22 push ds
23 ePUSHA
24
[90]25 LOAD_BDA_SEGMENT_TO es, ax
[229]26 sti ; Enable interrupts
27 test BYTE [es:BDA.bKBFlgs1], (1<<2) ; Clears ZF if CTRL is held down
[90]28 jnz SHORT .SkipRomInitialization
[3]29
[229]30 ; Install INT 19h handler (boot loader) where drives are detected
[258]31 mov al, BIOS_BOOT_LOADER_INTERRUPT_19h
[243]32 mov si, Int19h_BootLoaderHandler
[258]33 call Interrupts_InstallHandlerToVectorInALFromCSSI
[229]34
[90]35.SkipRomInitialization:
[3]36 ePOPA
37 pop ds
38 pop es
39 popf
40 retf
41
42
43;--------------------------------------------------------------------
44; Initializes the BIOS variables and detects IDE drives.
45;
46; Initialize_AndDetectDrives
47; Parameters:
[90]48; ES: BDA Segment
[3]49; Returns:
[97]50; DS: RAMVARS segment
[3]51; Corrupts registers:
[97]52; All
[3]53;--------------------------------------------------------------------
54Initialize_AndDetectDrives:
[130]55 call BootMenuPrint_InitializeDisplayContext
[3]56 call DetectPrint_RomFoundAtSegment
57 call RamVars_Initialize
[33]58 call Interrupts_InitializeInterruptVectors
[3]59 call DetectDrives_FromAllIDEControllers
[98]60 ; Fall to .StoreDptPointersToIntVectors
[97]61
62;--------------------------------------------------------------------
[98]63; .StoreDptPointersToIntVectors
[97]64; Parameters:
65; DS: RAMVARS segment
66; ES: BDA and interrupt vector segment (zero)
67; Returns:
68; Nothing
69; Corrupts registers:
70; DX, DI
71;--------------------------------------------------------------------
[98]72.StoreDptPointersToIntVectors:
[97]73 mov dl, 80h
[262]74 call FindDPT_ForDriveNumberInDL ; DPT to DS:DI
[258]75 jc SHORT .FindForDrive81h ; Store nothing if not our drive
[152]76 mov [es:HD0_DPT_POINTER_41h*4], di
77 mov [es:HD0_DPT_POINTER_41h*4+2], ds
[97]78.FindForDrive81h:
79 inc dx
[262]80 call FindDPT_ForDriveNumberInDL
[258]81 jc SHORT .ResetDetectedDrives
[152]82 mov [es:HD1_DPT_POINTER_46h*4], di
83 mov [es:HD1_DPT_POINTER_46h*4+2], ds
[33]84 ; Fall to .ResetDetectedDrives
[3]85
86;--------------------------------------------------------------------
[97]87; .ResetDetectedDrives
[3]88; Parameters:
89; DS: RAMVARS segment
[243]90; ES: BDA and interrupt vector segment (zero)
[3]91; Returns:
92; Nothing
93; Corrupts registers:
[243]94; All, except DS and ES
[3]95;--------------------------------------------------------------------
[33]96.ResetDetectedDrives:
[150]97 call Idepack_FakeToSSBP
[271]98 call AH0h_ResetAllOurHardDisksAtTheEndOfDriveInitialization
[158]99 add sp, BYTE EXTRA_BYTES_FOR_INTPACK
[150]100 ret
Note: See TracBrowser for help on using the repository browser.