You are on page 1of 6

Ministerul Educaiei Republicii Moldova

Universitatea Tehnic a Moldovei

Facultatea Calculatoare, Informatic si Microelectronic


Filiera Anglofon

RAPORT
Lucrare de curs
la Structuri de Date i Algoritmi
Tema : DOS and BIOS services in C

A efectuat:

st. gr. FAF-141 (l. eng.)

A. Culeva

A verificat:

dr. conf. univ.

M. Kulev
Chiinu
2015

Introduction.....................................................................
..................................

What are BIOS and DOS all about?


BIOS (basic input/output system) is the program a personal computer's
microprocessor uses to get the computer system started after you
turn it on. It also manages data flow between the computer's operating
system and attached devices such as the hard disk , video adapter ,
keyboard , mouse and printer.
BIOS is an integral part of a computer and comes with it when brought
home. (In contrast, the operating system can either be pre-installed by
the manufacturer or vendor or installed by the user.) BIOS is a program
that is made accessible to the microprocessor on an erasable
programmable read-only memory (EPROM ) chip. When you turn on
your computer, the microprocessor passes control to the BIOS
program, which is always located at the same place on EPROM.
In contrast to BIOS, DOS is not a built-in part of a computer. DOS (Disk
Operating System) was the first widely-installed operating system for
personal computers. (Earlier, the same name had been used for an IBM
operating system for a line of business computers.)
The ROM routines are accessed via the Intel 8088/86 software
generated interrupts. Parameters are passed to and from the BIOS
routines using the 8088/86 CPU registers.

An interrupt is a signal
to the emitted by
hardware or software
indicating an event that
needs immediate
attention. An interrupt
alerts the processor to a
high-priority condition
requiring the interruption
of the current code the
processor is executing.
The processor responds
by suspending its current
activities, saving its, and
executing a called an (or
an interrupt service
routine, ISR) to deal with
the event. This
interruption is temporary,
and, after the interrupt
handler finishes, the
processor resumes normal
activities. There are two types of interrupts: hardware interrupts and
software interrupts.
Purpose of BIOS calls
BIOS interrupt calls perform hardware control or I/O functions
requested by a program, return system information to the program, or
do both. A key element of the purpose of BIOS calls is abstractionthe
BIOS calls perform generally defined functions, and the specific details
of how those functions are executed on the particular hardware of the
system are encapsulated in the BIOS and hidden from the program. So,
for example, a program that wants to read from a hard disk does not
need to know whether the hard disk is an ATA, SCSI, or SATA drive (or
in earlier days, an ESDI drive, or an MFM or RLL drive with perhaps a
Seagate ST-506 controller, perhaps one of the several Western
Digitalcontroller types, or with a different proprietary controller of
another brand). The program only needs to identify the number of the
drive it wishes to access and the address of the sector it needs to read
or write, and the BIOS will take care of translating this general request
into the specific sequence of elementary operations required to
complete the task through the particular disk controller hardware that
is connected to that drive. The program is freed from needing to know

how to control at a low level every type of hard disk (or display
adapter, or port interface, or real-time clock peripheral) that it may
need to access. This both makes programming operating systems and
applications easier and makes the programs smaller, reducing the
duplication of program code, as the functionality that is included in the
BIOS does not need to be included in every program that needs it;
relatively short calls to the BIOS are included there instead. (In
operating systems where the BIOS is not used, service calls provided
by the operating system itself generally fulfill the same function and
purpose.)
Calling BIOS service calls
Operating systems and other software communicates with the BIOS
software, in order to control the installed hardware, via software
interrupts. A software interrupt is a specific variety of the general
concept of an interrupt. An interrupt is a mechanism by which the CPU
can be directed to stop executing the main-line program and
immediately execute a special program, called an Interrupt Service
Routine (ISR), instead. Once the ISR finishes, the CPU continues with
the main program. On x86 CPUs, the ISR to call when an interrupt
occurs is found by looking it up in a table of their addresses (called
"interrupt vectors") in memory. An interrupt is invoked by its type
number, from 0 to 255; the type number is used as an index into this
table; the address found in the table is the address of the ISR that will
be run in response to the interrupt. A software interrupt is simply an
interrupt that is triggered by a software command; therefore, software
interrupts function like subroutines, with the main difference that the
program that makes a software interrupt call does not need to know
the address of the ISR, only its interrupt number. This has advantages
for modularity, compatibility, and flexibility in system configuration.
The following is a list of the standard BIOS interrupts used in a typical
BIOS.

Interrup

Address

Type

00h
01h
02h
03h

0000:0000h
0000:0004h
0000:0008h
0000:000Ch

Processor
Processor
Processor
Processor

Divide by zero
Single step
Non maskable interrupt (NMI)
Breakpoint

04h

0000:0010h

Processor

Arithmetic overflow

05h

0000:0014h

Software

Print screen

Description

06h
07h
08h

0000:0018h
0000:001Ch
0000:0020h

Processor
Processor
Hardware

Invalid op code
Coprocessor not available
System timer service routine

09h

0000:0024h

Hardware

Keyboard device service routine

0Ah

0000:0028h

Hardware

0Bh
0Ch
0Dh

0000:002Ch
0000:0030h
0000:0034h

Hardware
Hardware
Hardware

Cascade from 2nd programmable interrupt


controller
Serial port service - COM post 2
Serial port service - COM port 1
Parallel printer service - LPT 2

0Eh

0000:0038h

Hardware

Floppy disk service

0Fh
10h
11h

0000:003Ch
0000:0040h
0000:0044h

Hardware
Software
Software

Parallel printer service - LPT 1


Video service routine
Equipment list service routine

12h

0000:0048H

Software

Memory size service routine

13h
14h
15h
16h

0000:004Ch
0000:0050h
0000:0054h
0000:0058h

Software
Software
Software
Software

Hard disk drive service


Serial communications service routines
System services support routines
Keyboard support service routines

17h

0000:005Ch

Software

Parallel printer support services

18h

0000:0060h

Software

Load and run ROM BASIC

19h

0000:0064h

Software

DOS loading routine

1Ah

0000:0068h

Software

Real time clock service routines

1Bh

0000:006Ch

Software

CRTL - BREAK service routines

1Ch

0000:0070h

Software

User timer service routine

1Dh
1Eh
1Fh

00000074h
0000:0078h
0000:007Ch

Software
Software
Software

Video control parameter table


Floppy disk parameter routine
Video graphics character routine

20h-3Fh

0000:0080f 0000:00FCh

SOftware

DOS interrupt points

40h
41h
42h

0000:0100h
0000:0104h
0000:0108h

Software
Software
Software

Floppy disk revector routine


hard disk drive C: parameter table
EGA default video driver

43h

0000:010Ch

Software

Video graphics characters

44h
45h
46h
47h

0000:0110h
0000:0114h
0000:0118h
0000:011Ch -

Software
Software
Software
Software

Novel Netware API


Not used
Hard disk drive D: parameter table
Not used

48h

Software

Not used

49h
0000:0124h
4Ah
0000:0128h
4Bh0000:012Ch 63h
64h
65h66h
67h
68h-6Fh 0000:01BCh
70h
0000:01c0h

Software
Software

Not used
User alarm

Software

Not used

Software

Novel Netware IPX

Software

Not used

Software
Software
Hardware

EMS support routines


Not used
Real time clock

71h

Hardware

Redirect interrupt cascade

0000:01C4h

72h74h

0000:01C8h 0000:01D0h

Hardware

Reserved - Do not use

75h

0000:01D4h

Hardware

Math coprocessor exception

76h

0000:01D8h

Hardware

Hard disk support

Hardware

Suspend request

Hardware

Not used

Software
Software

Novell Netware API


Not used

77h
0000:01DCh
78h0000:01E0h 79h
7Ah
78h-FFh 0000:03FCh

Table 1. List of standard BIOS interrupts

You might also like