The BIOS provides a hardware-independent interface for input/output operations and memory access. It contains routines that are executed at startup to initialize devices and provide services like video display functions, disk access, keyboard input, and real-time clock functions. These routines are called through interrupts and provide a standardized way to perform basic low-level system operations regardless of the specific hardware configuration.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
61 views12 pages
BIOS, File I
The BIOS provides a hardware-independent interface for input/output operations and memory access. It contains routines that are executed at startup to initialize devices and provide services like video display functions, disk access, keyboard input, and real-time clock functions. These routines are called through interrupts and provide a standardized way to perform basic low-level system operations regardless of the specific hardware configuration.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 12
BIOS, File I/O
• Programarea directa a hardware-ului e dificila, solutia -> o colectie
de rutine care permit efectuarea operatiilor I/O si apelarea memoriei • La pornirea sistemului, se apeleaza direct memoria ROM in care se afla Basic Input Output System (BIOS) • Rutinele BIOS furnizeaza o interfata independenta de hardware pentru diversele device-uri ale sistemului, de ex. un driver pentru placa video care permite afisarea pe ecran indiferent de tipul de display utilizat. • Pentru a apela o rutina, se lanseaza o intrerupere, sub forma: int value • Value e intre 0…255 • Cand se reseteaza sistemul, se initializeaza vectorul de intreruperi pentru a point-a la rutinele BIOS Serviciile BIOS • BIOS-ul utilizeaza intreruperile 5 si 10h…1Ah pentru a realiza diferite operatii INT Function 5 Print Screen operation. 10h Video display services. 11h Equipment determination. 12h Memory size determination. 13h Diskette and hard disk services. 14h Serial I/O services. 15h Miscellaneous services. 16h Keyboard services. 17h Printer services. 18h BASIC. 19h Reboot. 1Ah Real time clock services. Int 5 – Print screen Instruction: int 5h BIOS Operation: Print the current text screen. Parameters: None • Cand se executa 5h PC-ul trimite o copie a imaginii de pe ecran (PrntScrn lanseaza un apel int 5)
Int 10h – video services
Instruction: int 10h BIOS Operation: Video I/O Services Parameters: cativa, dati in ax, bx, cx, dx, si es:bp • Se poate utiliza pentru a initializa display-ul, setarea cursorului, citirea si scrierea caracterelor, etc. Int 11h – instalare echipament Instruction: int 11h BIOS Operation: Returneaza o lista de echipamente Parameters: La intrare: None, la exit: AX • ax contine o lista codata a echipamentelor Bit 0 Floppy disk drive installed Bit 1 Math coprocessor installed Bits 2,3 System board RAM installed (obsolete) Bits 4,5 Initial video mode 00 nimic 01 40x25 color 10 80x25 color 11 80x25 b/w Bits 6,7 Numarul de disk drives Bit 8 DMA present Bits 9,10,11 Numarul de RS-232 serial cards instalate Bit 12 Game I/O card installed Bit 13 Serial printer attached Bits 14,15 Number of printers attached. Int 12h – memorie disponibila Instruction: int 12h BIOS Operation: Determinea dimensiunea memoriei Parameters: dimensiunea memoriei returnata in AX • Cand memoria sistemului era 64k, avea sens, acum nu prea mai are
Int 13h – servicii pentru disk
Instruction: int 13h BIOS Operation: Servicii disk Parameters: ax, es:bx, cx, dx • Resertare diskete, obtinere status, citire, scriere, verificare sectoare, formatare, etc. rutina s-a modificat mult de-a lungul timpului Int 14h – Serial I/O Instruction: int 14h BIOS Operation: Accesarea portului serial Parameters: ax, dx • Suporta: initializare, transmitere caracter, primire caracter, status • Numarul portului serial este stocat in dx, celelalte date sunt stocate in al si ax Int 14h – Serial I/O AH = 0: initializare port AH = 1: transmitere caracter mov dx, 0 ;Select COM1: Bits Function 5..7 Select baud rate mov al, ‘a’ ;Character to transmit 000- 110 baud mov ah, 1 ;Transmit opcode 001- 150 int 14h 010- 300 test ah, 80h ;Check for error 011- 600 100- 1200 jnz SerialError 101- 2400 110- 4800 111- 9600 3..4 Select parity AH = 2: receptie caracter 00- No parity mov dx, 0 ;Select COM1: 01- Odd parity 10- No parity mov ah, 2 ;Receive opcode 11- Even parity int 14h 2 Stop bits test ah, 80h ;Check for error 0-One stop bit jnz SerialError 1-Two stop bits 0..1 Character Size <Received character is now in AL> 10- 7 bits 11- 8 bits Int 15 - diverse • Initial era pentru casete, acum e pentru diverse chestii (memorie extinsa, controller joystick, altele) Int 16 - tastatura Instruction: int 16h BIOS Operation: Read a key, test for a key, or get keyboard status Parameters: al • AH = 0 – citire tasta; ex. citeste taste pana la enter
ReadLoop: mov ah, 0 ;Read Key opcode
int 16h cmp al, 0 ;Special function? jz ReadLoop ;If so, don’t echo this keystroke putc cmp al, 0dh ;Carriage return (ENTER)? jne ReadLoop Int 17h - imprimante Instruction: int 17h BIOS Operation: Print data and test the printer status Parameters: ax, dx • Controleaza interfata paralela asa cum 14h controleaza interfata seriala • Are trei subfunctii 0-Print the character in the AL register. 1-Initialize the printer. 2-Return the printer status. Int 18h – run BASIC Instruction: int 18h BIOS Operation: Activate ROM BASIC Parameters: None • Activeaza interpretorul ROM BASIC
Int 19h – reboot computer
Instruction: int 19h BIOS Operation: Restart the system Parameters: None • Este echivalenta cu ctrl – alt – del Int 1Ah – Real Time Clock Instruction: int 1ah BIOS Operation: Real time clock services Parameters: ax, cx, dx • Sunt doua servicii furnizate de BIOS – read si set clock AH=0: Read the Real Time Clock Reg Value Returned dx L.O. word of clock count cx H.O. word of clock count al Zero if timer has not run for more than 24 hours Non-zero otherwise
AH=1: Set the Real Time Clock
cx:dx contine numarul curent in incremente de 55ms de la inceputul zilei cx contine HO word si dx contine LO word