<s>
BIOS	B-Device
interrupt	I-Device
calls	I-Device
are	O
a	O
facility	O
that	O
operating	B-General_Concept
systems	I-General_Concept
and	O
application	O
programs	O
use	O
to	O
invoke	O
the	O
facilities	O
of	O
the	O
Basic	B-Operating_System
Input/Output	I-Operating_System
System	I-Operating_System
firmware	O
on	O
IBM	B-Device
PC	I-Device
compatible	O
computers	O
.	O
</s>
<s>
Traditionally	O
,	O
BIOS	B-Device
calls	I-Device
are	O
mainly	O
used	O
by	O
DOS	B-Device
programs	O
and	O
some	O
other	O
software	O
such	O
as	O
boot	B-Application
loaders	I-Application
(	O
including	O
,	O
mostly	O
historically	O
,	O
relatively	O
simple	O
application	O
software	O
that	O
boots	O
directly	O
and	O
runs	O
without	O
an	O
operating	O
systemespecially	O
game	O
software	O
)	O
.	O
</s>
<s>
BIOS	B-Operating_System
runs	O
in	O
the	O
real	B-Application
address	I-Application
mode	I-Application
(	O
Real	B-Application
Mode	I-Application
)	O
of	O
the	O
x86	B-Operating_System
CPU	O
,	O
so	O
programs	O
that	O
call	O
BIOS	B-Operating_System
either	O
must	O
also	O
run	O
in	O
real	B-Application
mode	I-Application
or	O
must	O
switch	O
from	O
protected	B-Application
mode	I-Application
to	O
real	B-Application
mode	I-Application
before	O
calling	O
BIOS	B-Operating_System
and	O
then	O
switching	O
back	O
again	O
.	O
</s>
<s>
For	O
this	O
reason	O
,	O
modern	O
operating	B-General_Concept
systems	I-General_Concept
that	O
use	O
the	O
CPU	O
in	O
Protected	B-Application
mode	I-Application
or	O
Long	B-Application
mode	I-Application
generally	O
do	O
not	O
use	O
the	O
BIOS	B-Device
interrupt	I-Device
calls	I-Device
to	O
support	O
system	O
functions	O
,	O
although	O
they	O
use	O
the	O
BIOS	B-Device
interrupt	I-Device
calls	I-Device
to	O
probe	O
and	O
initialize	O
hardware	O
during	O
booting	B-Operating_System
.	O
</s>
<s>
Real	B-Application
mode	I-Application
has	O
the	O
1MB	O
memory	O
limitation	O
,	O
modern	O
boot	B-Application
loaders	I-Application
(	O
e.g.	O
</s>
<s>
GRUB2	O
,	O
Windows	B-Operating_System
Boot	I-Operating_System
Manager	I-Operating_System
)	O
use	O
the	O
unreal	B-Device
mode	I-Device
or	O
protected	B-Application
mode	I-Application
(	O
and	O
execute	O
the	O
BIOS	B-Device
interrupt	I-Device
calls	I-Device
in	O
the	O
Virtual	B-Application
8086	I-Application
mode	I-Application
,	O
but	O
only	O
for	O
OS	O
booting	B-Operating_System
)	O
to	O
access	O
up	O
to	O
4GB	O
memory	O
.	O
</s>
<s>
In	O
a	O
PC	O
,	O
the	O
BIOS	B-Operating_System
,	O
pre-loaded	O
in	O
ROM	O
on	O
the	O
motherboard	O
,	O
takes	O
control	O
immediately	O
after	O
the	O
CPU	O
is	O
reset	O
,	O
including	O
during	O
power-up	O
,	O
when	O
a	O
hardware	O
reset	O
button	O
is	O
pressed	O
,	O
or	O
when	O
a	O
critical	O
software	O
failure	O
(	O
a	O
triple	B-Error_Name
fault	I-Error_Name
)	O
causes	O
the	O
mainboard	O
circuitry	O
to	O
automatically	O
trigger	O
a	O
hardware	O
reset	O
.	O
</s>
<s>
The	O
BIOS	B-Operating_System
tests	O
the	O
hardware	O
and	O
initializes	O
its	O
state	O
;	O
finds	O
,	O
loads	O
,	O
and	O
runs	O
the	O
boot	B-Operating_System
program	I-Operating_System
(	O
usually	O
,	O
an	O
OS	O
boot	B-Application
loader	I-Application
,	O
and	O
historical	O
ROM	O
BASIC	O
)	O
;	O
and	O
provides	O
basic	O
hardware	O
control	O
to	O
the	O
software	O
running	O
on	O
the	O
machine	O
,	O
which	O
is	O
usually	O
an	O
operating	B-General_Concept
system	I-General_Concept
(	O
with	O
application	O
programs	O
)	O
but	O
may	O
be	O
a	O
directly	O
booting	B-Operating_System
single	O
software	O
application	O
.	O
</s>
<s>
For	O
IBM	O
's	O
part	O
,	O
they	O
provided	O
all	O
the	O
information	O
needed	O
to	O
use	O
their	O
BIOS	B-Operating_System
fully	O
or	O
to	O
directly	O
utilize	O
the	O
hardware	O
and	O
avoid	O
BIOS	B-Operating_System
completely	O
,	O
when	O
programming	O
the	O
early	O
IBM	B-Device
PC	I-Device
models	O
(	O
prior	O
to	O
the	O
PS/2	O
)	O
.	O
</s>
<s>
From	O
the	O
beginning	O
,	O
programmers	O
had	O
the	O
choice	O
of	O
using	O
BIOS	B-Operating_System
or	O
not	O
,	O
on	O
a	O
per-hardware-peripheral	O
basis	O
.	O
</s>
<s>
IBM	O
did	O
strongly	O
encourage	O
the	O
authorship	O
of	O
"	O
well-behaved	O
"	O
programs	O
that	O
accessed	O
hardware	O
only	O
through	O
BIOS	B-Operating_System
INT	B-Device
calls	O
(	O
and	O
DOS	B-Device
service	O
calls	O
)	O
,	O
to	O
support	O
compatibility	O
of	O
software	O
with	O
current	O
and	O
future	O
PC	O
models	O
having	O
dissimilar	O
peripheral	O
hardware	O
,	O
but	O
IBM	O
understood	O
that	O
for	O
some	O
software	O
developers	O
and	O
hardware	O
customers	O
,	O
a	O
capability	O
for	O
user	O
software	O
to	O
directly	O
control	O
the	O
hardware	O
was	O
a	O
requirement	O
.	O
</s>
<s>
In	O
part	O
,	O
this	O
was	O
because	O
a	O
significant	O
subset	O
of	O
all	O
the	O
hardware	O
features	O
and	O
functions	O
was	O
not	O
exposed	O
by	O
the	O
BIOS	B-Operating_System
services	O
.	O
</s>
<s>
For	O
two	O
examples	O
(	O
among	O
many	O
)	O
,	O
the	O
MDA	O
and	O
CGA	O
adapters	O
are	O
capable	O
of	O
hardware	O
scrolling	O
,	O
and	O
the	O
PC	O
serial	O
adapter	O
is	O
capable	O
of	O
interrupt-driven	O
data	O
transfer	O
,	O
but	O
the	O
IBM	B-Operating_System
BIOS	I-Operating_System
supports	O
neither	O
of	O
these	O
useful	O
technical	O
features	O
.	O
</s>
<s>
Today	O
,	O
the	O
BIOS	B-Operating_System
in	O
a	O
new	O
PC	O
still	O
supports	O
most	O
,	O
if	O
not	O
all	O
,	O
of	O
the	O
BIOS	B-Device
interrupt	I-Device
function	O
calls	O
defined	O
by	O
IBM	O
for	O
the	O
IBM	B-Operating_System
AT	I-Operating_System
(	O
introduced	O
in	O
1984	O
)	O
,	O
along	O
with	O
many	O
more	O
newer	O
ones	O
,	O
plus	O
extensions	O
to	O
some	O
of	O
the	O
originals	O
(	O
e.g.	O
</s>
<s>
This	O
,	O
combined	O
with	O
a	O
similar	O
degree	O
of	O
hardware	O
compatibility	O
,	O
means	O
that	O
most	O
programs	O
written	O
for	O
an	O
IBM	B-Operating_System
AT	I-Operating_System
can	O
still	O
run	O
correctly	O
on	O
a	O
new	O
PC	O
today	O
,	O
assuming	O
that	O
the	O
faster	O
speed	O
of	O
execution	O
is	O
acceptable	O
(	O
which	O
it	O
typically	O
is	O
for	O
all	O
but	O
games	O
that	O
use	O
CPU-based	O
timing	O
)	O
.	O
</s>
<s>
Despite	O
the	O
considerable	O
limitations	O
of	O
the	O
services	O
accessed	O
through	O
the	O
BIOS	B-Device
interrupts	I-Device
,	O
they	O
have	O
proven	O
extremely	O
useful	O
and	O
durable	O
to	O
technological	O
change	O
.	O
</s>
<s>
BIOS	B-Device
interrupt	I-Device
calls	I-Device
perform	O
hardware	O
control	O
or	O
I/O	O
functions	O
requested	O
by	O
a	O
program	O
,	O
return	O
system	O
information	O
to	O
the	O
program	O
,	O
or	O
do	O
both	O
.	O
</s>
<s>
A	O
key	O
element	O
of	O
the	O
purpose	O
of	O
BIOS	B-Device
calls	I-Device
is	O
abstraction	O
-	O
the	O
BIOS	B-Device
calls	I-Device
perform	O
generally	O
defined	O
functions	O
,	O
and	O
the	O
specific	O
details	O
of	O
how	O
those	O
functions	O
are	O
executed	O
on	O
the	O
particular	O
hardware	O
of	O
the	O
system	O
are	O
encapsulated	O
in	O
the	O
BIOS	B-Operating_System
and	O
hidden	O
from	O
the	O
program	O
.	O
</s>
<s>
So	O
,	O
for	O
example	O
,	O
a	O
program	O
that	O
wants	O
to	O
read	O
from	O
a	O
hard	O
disk	O
does	O
not	O
need	O
to	O
know	O
whether	O
the	O
hard	O
disk	O
is	O
an	O
ATA	B-Protocol
,	O
SCSI	B-Architecture
,	O
or	O
SATA	O
drive	O
(	O
or	O
in	O
earlier	O
days	O
,	O
an	O
ESDI	B-Architecture
drive	O
,	O
or	O
an	O
MFM	B-Protocol
or	O
RLL	B-Protocol
drive	O
with	O
perhaps	O
a	O
Seagate	O
ST-506	B-Device
controller	O
,	O
perhaps	O
one	O
of	O
the	O
several	O
Western	O
Digital	O
controller	O
types	O
,	O
or	O
with	O
a	O
different	O
proprietary	O
controller	O
of	O
another	O
brand	O
)	O
.	O
</s>
<s>
The	O
program	O
only	O
needs	O
to	O
identify	O
the	O
BIOS-defined	O
number	O
of	O
the	O
drive	O
it	O
wishes	O
to	O
access	O
and	O
the	O
address	O
of	O
the	O
sector	O
it	O
needs	O
to	O
read	O
or	O
write	O
,	O
and	O
the	O
BIOS	B-Operating_System
will	O
take	O
care	O
of	O
translating	O
this	O
general	O
request	O
into	O
the	O
specific	O
sequence	O
of	O
elementary	O
operations	O
required	O
to	O
complete	O
the	O
task	O
through	O
the	O
particular	O
disk	O
controller	O
hardware	O
that	O
is	O
connected	O
to	O
that	O
drive	O
.	O
</s>
<s>
This	O
both	O
makes	O
programming	O
operating	B-General_Concept
systems	I-General_Concept
and	O
applications	O
easier	O
and	O
makes	O
the	O
programs	O
smaller	O
,	O
reducing	O
the	O
duplication	O
of	O
program	O
code	O
,	O
as	O
the	O
functionality	O
that	O
is	O
included	O
in	O
the	O
BIOS	B-Operating_System
does	O
not	O
need	O
to	O
be	O
included	O
in	O
every	O
program	O
that	O
needs	O
it	O
;	O
relatively	O
short	O
calls	O
to	O
the	O
BIOS	B-Operating_System
are	O
included	O
in	O
the	O
programs	O
instead	O
.	O
</s>
<s>
(	O
In	O
operating	B-General_Concept
systems	I-General_Concept
where	O
the	O
BIOS	B-Operating_System
is	O
not	O
used	O
,	O
service	O
calls	O
provided	O
by	O
the	O
operating	B-General_Concept
system	I-General_Concept
itself	O
generally	O
fulfill	O
the	O
same	O
function	O
and	O
purpose	O
.	O
)	O
</s>
<s>
The	O
BIOS	B-Operating_System
also	O
frees	O
computer	O
hardware	O
designers	O
(	O
to	O
the	O
extent	O
that	O
programs	O
are	O
written	O
to	O
use	O
the	O
BIOS	B-Operating_System
exclusively	O
)	O
from	O
being	O
constrained	O
to	O
maintain	O
exact	O
hardware	O
compatibility	O
with	O
old	O
systems	O
when	O
designing	O
new	O
systems	O
,	O
in	O
order	O
to	O
maintain	O
compatibility	O
with	O
existing	O
software	O
.	O
</s>
<s>
For	O
example	O
,	O
the	O
keyboard	O
hardware	O
on	O
the	O
IBM	B-Device
PCjr	I-Device
works	O
very	O
differently	O
than	O
the	O
keyboard	O
hardware	O
on	O
earlier	O
IBM	B-Device
PC	I-Device
models	O
,	O
but	O
to	O
programs	O
that	O
use	O
the	O
keyboard	O
only	O
through	O
the	O
BIOS	B-Operating_System
,	O
this	O
difference	O
is	O
nearly	O
invisible	O
.	O
</s>
<s>
(	O
As	O
a	O
good	O
example	O
of	O
the	O
other	O
side	O
of	O
this	O
issue	O
,	O
a	O
significant	O
share	O
of	O
the	O
PC	O
programs	O
in	O
use	O
at	O
the	O
time	O
the	O
PCjr	B-Device
was	O
introduced	O
did	O
not	O
use	O
the	O
keyboard	O
through	O
BIOS	B-Operating_System
exclusively	O
,	O
so	O
IBM	O
also	O
included	O
hardware	O
features	O
in	O
the	O
PCjr	B-Device
to	O
emulate	O
the	O
way	O
the	O
original	B-Device
IBM	I-Device
PC	I-Device
and	O
IBM	B-Device
PC	I-Device
XT	I-Device
keyboard	O
hardware	O
works	O
.	O
</s>
<s>
The	O
hardware	O
emulation	O
is	O
not	O
exact	O
,	O
so	O
not	O
all	O
programs	O
that	O
try	O
to	O
use	O
the	O
keyboard	O
hardware	O
directly	O
will	O
work	O
correctly	O
on	O
the	O
PCjr	B-Device
,	O
but	O
all	O
programs	O
that	O
use	O
only	O
the	O
BIOS	B-Operating_System
keyboard	O
services	O
will	O
.	O
)	O
</s>
<s>
In	O
addition	O
to	O
giving	O
access	O
to	O
hardware	O
facilities	O
,	O
BIOS	B-Operating_System
provides	O
added	O
facilities	O
that	O
are	O
implemented	O
in	O
the	O
BIOS	B-Operating_System
software	O
.	O
</s>
<s>
For	O
example	O
,	O
the	O
BIOS	B-Operating_System
maintains	O
separate	O
cursor	O
positions	O
for	O
up	O
to	O
eight	O
text	O
display	O
pages	O
and	O
provides	O
for	O
TTY-like	O
output	O
with	O
automatic	O
line	O
wrap	O
and	O
interpretation	O
of	O
basic	O
control	O
characters	O
such	O
as	O
carriage	O
return	O
and	O
line	O
feed	O
,	O
whereas	O
the	O
CGA-compatible	O
text	O
display	O
hardware	O
has	O
only	O
one	O
global	O
display	O
cursor	O
and	O
cannot	O
automatically	O
advance	O
the	O
cursor	O
,	O
use	O
the	O
cursor	O
position	O
to	O
address	O
the	O
display	O
memory	O
(	O
so	O
as	O
to	O
determine	O
which	O
character	O
cell	O
will	O
be	O
changed	O
or	O
examined	O
)	O
,	O
or	O
interpret	O
control	O
characters	O
.	O
</s>
<s>
For	O
another	O
example	O
,	O
the	O
BIOS	B-Operating_System
keyboard	O
interface	O
interprets	O
many	O
keystrokes	O
and	O
key	O
combinations	O
to	O
keep	O
track	O
of	O
the	O
various	O
shift	O
states	O
(	O
left	O
and	O
right	O
Shift	O
,	O
Ctrl	O
,	O
and	O
Alt	O
)	O
,	O
to	O
call	O
the	O
print-screen	O
service	O
when	O
Shift+PrtScrn	O
is	O
pressed	O
,	O
to	O
reboot	O
the	O
system	O
when	O
Ctrl+Alt+Del	O
is	O
pressed	O
,	O
to	O
keep	O
track	O
of	O
the	O
lock	O
states	O
(	O
Caps	O
Lock	O
,	O
Num	O
Lock	O
,	O
and	O
Scroll	O
Lock	O
)	O
and	O
,	O
in	O
AT-class	O
machines	O
,	O
control	O
the	O
corresponding	O
lock-state	O
indicator	O
lights	O
on	O
the	O
keyboard	O
,	O
and	O
to	O
perform	O
other	O
similar	O
interpretive	O
and	O
management	O
functions	O
for	O
the	O
keyboard	O
.	O
</s>
<s>
Operating	B-General_Concept
systems	I-General_Concept
and	O
other	O
software	O
communicate	O
with	O
the	O
BIOS	B-Operating_System
software	O
,	O
in	O
order	O
to	O
control	O
the	O
installed	O
hardware	O
,	O
via	O
software	O
interrupts	B-Application
.	O
</s>
<s>
A	O
software	O
interrupt	B-Application
is	O
a	O
specific	O
variety	O
of	O
the	O
general	O
concept	O
of	O
an	O
interrupt	B-Application
.	O
</s>
<s>
directed	O
to	O
stop	O
executing	O
the	O
main-line	O
program	O
and	O
immediately	O
execute	O
a	O
special	O
program	O
,	O
called	O
an	O
Interrupt	B-Application
Service	O
Routine	O
(	O
ISR	O
)	O
,	O
instead	O
.	O
</s>
<s>
On	O
x86	B-Operating_System
CPUs	O
,	O
when	O
an	O
interrupt	B-Application
occurs	O
,	O
the	O
ISR	O
to	O
call	O
is	O
found	O
by	O
looking	O
it	O
up	O
in	O
a	O
table	O
of	O
ISR	O
starting-point	O
addresses	O
(	O
called	O
"	O
interrupt	B-General_Concept
vectors	I-General_Concept
"	O
)	O
in	O
memory	O
:	O
the	O
Interrupt	B-General_Concept
vector	I-General_Concept
table	I-General_Concept
(	O
IVT	O
)	O
.	O
</s>
<s>
An	O
interrupt	B-Application
is	O
invoked	O
by	O
its	O
type	O
number	O
,	O
from	O
0	O
to	O
255	O
,	O
and	O
the	O
type	O
number	O
is	O
used	O
as	O
an	O
index	O
into	O
the	O
Interrupt	B-General_Concept
Vector	I-General_Concept
Table	I-General_Concept
,	O
and	O
at	O
that	O
index	O
in	O
the	O
table	O
is	O
found	O
the	O
address	O
of	O
the	O
ISR	O
that	O
will	O
be	O
run	O
in	O
response	O
to	O
the	O
interrupt	B-Application
.	O
</s>
<s>
A	O
software	O
interrupt	B-Application
is	O
simply	O
an	O
interrupt	B-Application
that	O
is	O
triggered	O
by	O
a	O
software	O
command	O
;	O
therefore	O
,	O
software	O
interrupts	B-Application
function	O
like	O
subroutines	O
,	O
with	O
the	O
main	O
difference	O
that	O
the	O
program	O
that	O
makes	O
a	O
software	O
interrupt	B-Application
call	O
does	O
not	O
need	O
to	O
know	O
the	O
address	O
of	O
the	O
ISR	O
,	O
only	O
its	O
interrupt	B-Application
number	O
.	O
</s>
<s>
BIOS	B-Device
interrupt	I-Device
calls	I-Device
can	O
be	O
thought	O
of	O
as	O
a	O
mechanism	O
for	O
passing	O
messages	O
between	O
BIOS	B-Operating_System
and	O
BIOS	B-Operating_System
client	O
software	O
such	O
as	O
an	O
operating	B-General_Concept
system	I-General_Concept
.	O
</s>
<s>
The	O
messages	O
request	O
data	O
or	O
action	O
from	O
BIOS	B-Operating_System
and	O
return	O
the	O
requested	O
data	O
,	O
status	O
information	O
,	O
and/or	O
the	O
product	O
of	O
the	O
requested	O
action	O
to	O
the	O
caller	O
.	O
</s>
<s>
The	O
messages	O
are	O
broken	O
into	O
categories	O
,	O
each	O
with	O
its	O
own	O
interrupt	B-Application
number	O
,	O
and	O
most	O
categories	O
contain	O
sub-categories	O
,	O
called	O
"	O
functions	O
"	O
and	O
identified	O
by	O
"	O
function	O
numbers	O
"	O
.	O
</s>
<s>
A	O
BIOS	B-Operating_System
client	O
passes	O
most	O
information	O
to	O
BIOS	B-Operating_System
in	O
CPU	O
registers	O
,	O
and	O
receives	O
most	O
information	O
back	O
the	O
same	O
way	O
,	O
but	O
data	O
too	O
large	O
to	O
fit	O
in	O
registers	O
,	O
such	O
as	O
tables	O
of	O
control	O
parameters	O
or	O
disk	O
sector	O
data	O
for	O
disk	O
transfers	O
,	O
is	O
passed	O
by	O
allocating	O
a	O
buffer	O
(	O
i.e.	O
</s>
<s>
(	O
Sometimes	O
multiple	O
addresses	O
of	O
data	O
items	O
in	O
memory	O
may	O
be	O
passed	O
in	O
a	O
data	O
structure	O
in	O
memory	O
,	O
with	O
the	O
address	O
of	O
that	O
structure	O
passed	O
to	O
BIOS	B-Operating_System
in	O
registers	O
.	O
)	O
</s>
<s>
The	O
interrupt	B-Application
number	O
is	O
specified	O
as	O
the	O
parameter	O
of	O
the	O
software	O
interrupt	B-Application
instruction	O
(	O
in	O
Intel	O
assembly	B-Language
language	I-Language
,	O
an	O
"	O
INT	B-Device
"	O
instruction	O
)	O
,	O
and	O
the	O
function	O
number	O
is	O
specified	O
in	O
the	O
AH	O
register	O
;	O
that	O
is	O
,	O
the	O
caller	O
sets	O
the	O
AH	O
register	O
to	O
the	O
number	O
of	O
the	O
desired	O
function	O
.	O
</s>
<s>
In	O
general	O
,	O
the	O
BIOS	B-Operating_System
services	O
corresponding	O
to	O
each	O
interrupt	B-Application
number	O
operate	O
independently	O
of	O
each	O
other	O
,	O
but	O
the	O
functions	O
within	O
one	O
interrupt	B-Application
service	O
are	O
handled	O
by	O
the	O
same	O
BIOS	B-Operating_System
program	O
and	O
are	O
not	O
independent	O
.	O
</s>
<s>
(	O
This	O
last	O
point	O
is	O
relevant	O
to	O
reentrancy	B-Operating_System
.	O
)	O
</s>
<s>
The	O
BIOS	B-Operating_System
software	O
usually	O
returns	O
to	O
the	O
caller	O
with	O
an	O
error	O
code	O
if	O
not	O
successful	O
,	O
or	O
with	O
a	O
status	O
code	O
and/or	O
requested	O
data	O
if	O
successful	O
.	O
</s>
<s>
The	O
data	O
itself	O
can	O
be	O
as	O
small	O
as	O
one	O
bit	O
or	O
as	O
large	O
as	O
65,536	O
bytes	O
of	O
whole	O
raw	O
disk	O
sectors	O
(	O
the	O
maximum	O
that	O
will	O
fit	O
into	O
one	O
real-mode	B-Application
memory	O
segment	O
)	O
.	O
</s>
<s>
BIOS	B-Operating_System
has	O
been	O
expanded	O
and	O
enhanced	O
over	O
the	O
years	O
many	O
times	O
by	O
many	O
different	O
corporate	O
entities	O
,	O
and	O
unfortunately	O
the	O
result	O
of	O
this	O
evolution	O
is	O
that	O
not	O
all	O
the	O
BIOS	B-Operating_System
functions	O
that	O
can	O
be	O
called	O
use	O
consistent	O
conventions	O
for	O
formatting	O
and	O
communicating	O
data	O
or	O
for	O
reporting	O
results	O
.	O
</s>
<s>
Some	O
BIOS	B-Operating_System
functions	O
report	O
detailed	O
status	O
information	O
,	O
while	O
others	O
may	O
not	O
even	O
report	O
success	O
or	O
failure	O
but	O
just	O
return	O
silently	O
,	O
leaving	O
the	O
caller	O
to	O
assume	O
success	O
(	O
or	O
to	O
test	O
the	O
outcome	O
some	O
other	O
way	O
)	O
.	O
</s>
<s>
Sometimes	O
it	O
can	O
also	O
be	O
difficult	O
to	O
determine	O
whether	O
or	O
not	O
a	O
certain	O
BIOS	B-Operating_System
function	O
call	O
is	O
supported	O
by	O
the	O
BIOS	B-Operating_System
on	O
a	O
certain	O
computer	O
,	O
or	O
what	O
the	O
limits	O
of	O
a	O
call	O
's	O
parameters	O
are	O
on	O
that	O
computer	O
.	O
</s>
<s>
(	O
For	O
some	O
invalid	O
function	O
numbers	O
,	O
or	O
valid	O
function	O
numbers	O
with	O
invalid	O
values	O
of	O
key	O
parametersparticularly	O
with	O
an	O
early	O
IBM	B-Operating_System
BIOS	I-Operating_System
versionthe	O
BIOS	B-Operating_System
may	O
do	O
nothing	O
and	O
return	O
with	O
no	O
error	O
code	O
;	O
then	O
it	O
is	O
the	O
[	O
inconvenient	O
but	O
inevitable ]	O
responsibility	O
of	O
the	O
caller	O
either	O
to	O
avoid	O
this	O
case	O
by	O
not	O
making	O
such	O
calls	O
,	O
or	O
to	O
positively	O
test	O
for	O
an	O
expected	O
effect	O
of	O
the	O
call	O
rather	O
than	O
assuming	O
that	O
the	O
call	O
was	O
effective	O
.	O
</s>
<s>
Because	O
BIOS	B-Operating_System
has	O
evolved	O
extensively	O
in	O
many	O
steps	O
over	O
its	O
history	O
,	O
a	O
function	O
that	O
is	O
valid	O
in	O
one	O
BIOS	B-Operating_System
version	O
from	O
some	O
certain	O
vendor	O
may	O
not	O
be	O
valid	O
in	O
an	O
earlier	O
or	O
divergent	O
BIOS	B-Operating_System
version	O
from	O
the	O
same	O
vendor	O
or	O
in	O
a	O
BIOS	B-Operating_System
versionof	O
any	O
relative	O
agefrom	O
a	O
different	O
vendor	O
.	O
)	O
</s>
<s>
Because	O
BIOS	B-Device
interrupt	I-Device
calls	I-Device
use	O
CPU	O
register-based	O
parameter	O
passing	O
,	O
the	O
calls	O
are	O
oriented	O
to	O
being	O
made	O
from	O
assembly	B-Language
language	I-Language
and	O
cannot	O
be	O
directly	O
made	O
from	O
most	O
high-level	B-Language
languages	I-Language
(	O
HLLs	O
)	O
.	O
</s>
<s>
However	O
,	O
a	O
high	B-Language
level	I-Language
language	I-Language
may	O
provide	O
a	O
library	O
of	O
wrapper	O
routines	O
which	O
translate	O
parameters	O
from	O
the	O
form	O
(	O
usually	O
stack-based	O
)	O
used	O
by	O
the	O
high-level	B-Language
language	I-Language
to	O
the	O
register-based	O
form	O
required	O
by	O
BIOS	B-Operating_System
,	O
then	O
back	O
to	O
the	O
HLL	O
calling	O
convention	O
after	O
the	O
BIOS	B-Operating_System
returns	O
.	O
</s>
<s>
In	O
some	O
variants	O
of	O
C	O
,	O
BIOS	B-Device
calls	I-Device
can	O
be	O
made	O
using	O
inline	O
assembly	B-Language
language	I-Language
within	O
a	O
C	O
module	O
.	O
</s>
<s>
(	O
Support	O
for	O
inline	O
assembly	B-Language
language	I-Language
is	O
not	O
part	O
of	O
the	O
ANSI	O
C	O
standard	O
but	O
is	O
a	O
language	O
extension	O
;	O
therefore	O
,	O
C	O
modules	O
that	O
use	O
inline	O
assembly	B-Language
language	I-Language
are	O
less	O
portable	O
than	O
pure	O
ANSI	O
standard	O
C	O
modules	O
.	O
)	O
</s>
<s>
Invoking	O
an	O
interrupt	B-Application
can	O
be	O
done	O
using	O
the	O
INT	B-Device
x86	B-Operating_System
assembly	B-Language
language	I-Language
instruction	O
.	O
</s>
<s>
For	O
example	O
,	O
to	O
print	O
a	O
character	O
to	O
the	O
screen	O
using	O
BIOS	B-Device
interrupt	I-Device
0x10	O
,	O
the	O
following	O
x86	B-Operating_System
assembly	B-Language
language	I-Language
instructions	O
could	O
be	O
executed	O
:	O
</s>
<s>
A	O
list	O
of	O
common	O
BIOS	B-Device
interrupt	I-Device
classes	O
can	O
be	O
found	O
below	O
.	O
</s>
<s>
Note	O
that	O
some	O
BIOSes	O
(	O
particularly	O
old	O
ones	O
)	O
do	O
not	O
implement	O
all	O
of	O
these	O
interrupt	B-Application
classes	O
.	O
</s>
<s>
The	O
BIOS	B-Operating_System
also	O
uses	O
some	O
interrupts	B-Application
to	O
relay	O
hardware	O
event	O
interrupts	B-Application
to	O
programs	O
which	O
choose	O
to	O
receive	O
them	O
or	O
to	O
route	O
messages	O
for	O
its	O
own	O
use	O
.	O
</s>
<s>
The	O
table	O
below	O
includes	O
only	O
those	O
BIOS	B-Device
interrupts	I-Device
which	O
are	O
intended	O
to	O
be	O
called	O
by	O
programs	O
(	O
using	O
the	O
"	O
INT	B-Device
"	O
assembly-language	O
software	O
interrupt	B-Application
instruction	O
)	O
to	O
request	O
services	O
or	O
information	O
.	O
</s>
<s>
Interrupt	B-Application
vectorDescriptionExecuted	O
when	O
Shift-Print	O
screen	O
is	O
pressed	O
,	O
as	O
well	O
as	O
when	O
the	O
instruction	O
detects	O
a	O
bound	O
failure.This	O
is	O
the	O
real	O
time	O
clock	O
interrupt	B-Application
.	O
</s>
<s>
The	O
BIOS	B-Operating_System
increments	O
the	O
time-of-day	O
counter	O
during	O
this	O
interrupt.This	O
is	O
the	O
Keyboard	O
interrupt	B-Application
.	O
</s>
<s>
DescriptionTurn	O
on	O
cassette	O
drive	O
motor	O
(	O
IBM	O
PC/PCjr	O
only	O
)	O
Turn	O
off	O
cassette	O
drive	O
motor	O
(	O
IBM	O
PC/PCjr	O
only	O
)	O
Read	O
data	O
blocks	O
from	O
cassette	O
(	O
IBM	O
PC/PCjr	O
only	O
)	O
Write	O
data	O
blocks	O
to	O
cassette	O
(	O
IBM	O
PC/PCjr	O
only	O
)	O
Keyboard	O
InterceptEvent	O
WaitRead	O
Joystick	O
(	O
BIOSes	O
from	O
1986	O
onward	O
)	O
Sysreq	O
Key	O
CalloutWaitMove	O
BlockGet	O
Extended	B-Device
Memory	I-Device
SizeSwitch	O
to	O
Protected	B-Application
ModeGet	O
System	O
ParametersGet	O
Extended	O
BIOS	B-Operating_System
Data	O
Area	O
SegmentPointing	O
Device	O
FunctionsWatchdog	O
Timer	O
Functions	O
-	O
PS/2	O
systems	O
onlyProgrammable	O
Option	O
Select	O
-	O
MCA	B-Device
bus	I-Device
PS/2	O
systems	O
onlyEISA	O
System	O
Functions	O
-	O
EISA	B-Device
bus	I-Device
systems	O
onlyGet	O
Extended	B-Device
Memory	I-Device
Size	O
(	O
Newer	O
function	O
,	O
since	O
1994	O
)	O
.	O
</s>
<s>
DescriptionPrint	O
Character	O
to	O
PrinterInitialize	O
PrinterCheck	O
Printer	O
StatusExecute	O
Cassette	O
BASIC	O
:	O
On	O
IBM	O
machines	O
up	O
to	O
the	O
early	O
PS/2	O
line	O
,	O
this	O
interrupt	B-Application
would	O
start	O
the	O
ROM	O
Cassette	O
BASIC	O
.	O
</s>
<s>
Clones	O
did	O
not	O
have	O
this	O
feature	O
and	O
different	O
machines/BIOSes	O
would	O
perform	O
a	O
variety	O
of	O
different	O
actions	O
if	O
INT	B-Device
18h	O
was	O
executed	O
,	O
most	O
commonly	O
an	O
error	O
message	O
stating	O
that	O
no	O
bootable	B-Operating_System
disk	O
was	O
present	O
.	O
</s>
<s>
Modern	O
machines	O
would	O
attempt	O
to	O
boot	B-Device
from	I-Device
a	I-Device
network	I-Device
through	O
this	O
interrupt	B-Application
.	O
</s>
<s>
On	O
modern	O
machines	O
this	O
interrupt	B-Application
will	O
be	O
treated	O
by	O
the	O
BIOS	B-Operating_System
as	O
a	O
signal	O
from	O
the	O
bootloader	B-Application
that	O
it	O
failed	O
to	O
complete	O
its	O
task	O
.	O
</s>
<s>
The	O
BIOS	B-Operating_System
can	O
then	O
take	O
appropriate	O
next	O
steps	O
.	O
</s>
<s>
*	O
BIOS	B-Operating_System
Boot	B-Operating_System
Specification	O
Version	O
1.01	O
January	O
11	O
1996	O
Appendix	O
DAfter	O
POST	O
this	O
interrupt	B-Application
is	O
used	O
by	O
the	O
BIOS	B-Operating_System
to	O
load	O
the	O
operating	B-General_Concept
system	I-General_Concept
.	O
</s>
<s>
This	O
call	O
would	O
typically	O
be	O
invoked	O
if	O
the	O
BIOS	B-Operating_System
was	O
unable	O
to	O
identify	O
any	O
bootable	B-Operating_System
disk	O
volumes	O
on	O
startup	O
.	O
</s>
<s>
At	O
the	O
time	O
the	O
original	B-Device
IBM	I-Device
PC	I-Device
(	O
IBM	O
machine	O
type	O
5150	O
)	O
was	O
released	O
in	O
1981	O
,	O
the	O
BASIC	O
in	O
ROM	O
was	O
a	O
key	O
feature	O
.	O
</s>
<s>
Contemporary	O
popular	O
personal	O
computers	O
such	O
as	O
the	O
Commodore	O
64	O
and	O
the	O
Apple	O
II	O
line	O
also	O
had	O
Microsoft	O
Cassette	O
BASIC	O
in	O
ROM	O
(	O
though	O
Commodore	O
renamed	O
their	O
licensed	O
version	O
Commodore	O
BASIC	O
)	O
,	O
so	O
in	O
a	O
substantial	O
portion	O
of	O
its	O
intended	O
market	O
,	O
the	O
IBM	B-Device
PC	I-Device
needed	O
BASIC	O
to	O
compete	O
.	O
</s>
<s>
As	O
on	O
those	O
other	O
systems	O
,	O
the	O
IBM	B-Device
PC	I-Device
's	O
ROM	O
BASIC	O
served	O
as	O
a	O
primitive	O
diskless	O
operating	B-General_Concept
system	I-General_Concept
,	O
allowing	O
the	O
user	O
to	O
load	O
,	O
save	O
,	O
and	O
run	O
programs	O
,	O
as	O
well	O
as	O
to	O
write	O
and	O
refine	O
them	O
.	O
</s>
<s>
(	O
The	O
original	B-Device
IBM	I-Device
PC	I-Device
was	O
also	O
the	O
only	O
PC	O
model	O
from	O
IBM	O
that	O
,	O
like	O
its	O
aforementioned	O
two	O
competitors	O
,	O
included	O
cassette	O
interface	O
hardware	O
.	O
</s>
<s>
A	O
base	O
model	O
IBM	B-Device
PC	I-Device
had	O
only	O
16	O
KiB	O
of	O
RAM	O
and	O
no	O
disk	O
drives	O
[	O
of	O
any	O
kind ]	O
,	O
so	O
the	O
cassette	O
interface	O
and	O
BASIC	O
in	O
ROM	O
were	O
essential	O
to	O
make	O
the	O
base	O
model	O
usable	O
.	O
</s>
<s>
An	O
IBM	B-Device
PC	I-Device
with	O
less	O
than	O
32	O
KiB	O
of	O
RAM	O
is	O
incapable	O
of	O
booting	B-Operating_System
from	O
disk	O
.	O
</s>
<s>
Of	O
the	O
five	O
8	O
KiB	O
ROM	O
chips	O
in	O
an	O
original	B-Device
IBM	I-Device
PC	I-Device
,	O
totaling	O
40	O
KiB	O
,	O
four	O
contain	O
BASIC	O
and	O
only	O
one	O
contains	O
the	O
BIOS	B-Operating_System
;	O
when	O
only	O
16	O
KiB	O
of	O
RAM	O
are	O
installed	O
,	O
the	O
ROM	O
BASIC	O
accounts	O
for	O
over	O
half	O
of	O
the	O
total	O
system	O
memory	O
[	O
4/7ths	O
,	O
to	O
be	O
precise ]	O
.	O
)	O
</s>
<s>
As	O
time	O
went	O
on	O
and	O
BASIC	O
was	O
no	O
longer	O
shipped	O
on	O
all	O
PCs	O
,	O
this	O
interrupt	B-Application
would	O
simply	O
display	O
an	O
error	O
message	O
indicating	O
that	O
no	O
bootable	B-Operating_System
volume	O
was	O
found	O
(	O
famously	O
,	O
"	O
No	O
ROM	O
BASIC	O
"	O
,	O
or	O
more	O
explanatory	O
messages	O
in	O
later	O
BIOS	B-Operating_System
versions	O
)	O
;	O
in	O
other	O
BIOS	B-Operating_System
versions	O
it	O
would	O
prompt	O
the	O
user	O
to	O
insert	O
a	O
bootable	B-Operating_System
volume	O
and	O
press	O
a	O
key	O
,	O
and	O
then	O
after	O
the	O
user	O
pressed	O
a	O
key	O
it	O
would	O
loop	O
back	O
to	O
the	O
bootstrap	B-Operating_System
loader	I-Operating_System
(	O
INT	B-Device
19h	O
)	O
to	O
try	O
booting	B-Operating_System
again	O
.	O
</s>
<s>
Digital	O
's	O
Rainbow	O
100B	O
used	O
to	O
call	O
its	O
BIOS	B-Operating_System
,	O
which	O
was	O
incompatible	O
with	O
the	O
IBM	B-Operating_System
BIOS	I-Operating_System
.	O
</s>
<s>
Turbo	B-Application
Pascal	I-Application
,	O
Turbo	B-Application
C	I-Application
and	O
Turbo	B-Application
C++	I-Application
repurposed	O
INT	B-Device
18	O
for	O
memory	O
allocation	O
and	O
paging	O
.	O
</s>
<s>
On	O
DOS	B-Device
systems	O
,	O
IO.SYS	O
or	O
IBMBIO.COM	O
hooks	O
INT	B-Device
13	I-Device
for	O
floppy	O
disk	O
change	O
detection	O
,	O
tracking	O
formatting	O
calls	O
,	O
correcting	O
DMA	O
boundary	O
errors	O
,	O
and	O
working	O
around	O
problems	O
in	O
IBM	O
's	O
ROM	B-Operating_System
BIOS	I-Operating_System
"	O
01/10/84	O
"	O
with	O
model	O
code	O
0xFC	O
before	O
the	O
first	O
call	O
.	O
</s>
<s>
Many	O
modern	O
operating	B-General_Concept
systems	I-General_Concept
(	O
such	O
as	O
Linux	B-Application
and	O
Windows	O
)	O
do	O
not	O
use	O
any	O
BIOS	B-Device
interrupt	I-Device
calls	I-Device
at	O
all	O
after	O
startup	O
,	O
instead	O
choosing	O
to	O
directly	O
interface	O
with	O
the	O
hardware	O
.	O
</s>
<s>
To	O
do	O
this	O
,	O
they	O
rely	O
upon	O
drivers	B-Application
that	O
are	O
either	O
a	O
part	O
of	O
the	O
OS	B-Operating_System
kernel	I-Operating_System
itself	O
,	O
ship	O
along	O
with	O
the	O
OS	O
,	O
or	O
are	O
provided	O
by	O
hardware	O
vendors	O
.	O
</s>
<s>
Most	O
significant	O
is	O
that	O
modern	O
operating	B-General_Concept
systems	I-General_Concept
run	O
with	O
the	O
processor	O
in	O
protected	B-Application
(	O
or	O
long	B-Application
)	O
mode	O
,	O
whereas	O
the	O
BIOS	B-Operating_System
code	O
will	O
only	O
execute	O
in	O
real	B-Application
mode	I-Application
.	O
</s>
<s>
This	O
means	O
that	O
if	O
an	O
OS	O
running	O
in	O
protected	B-Application
mode	I-Application
wanted	O
to	O
make	O
a	O
BIOS	B-Device
call	I-Device
,	O
it	O
would	O
have	O
to	O
first	O
switch	O
into	O
real	B-Application
mode	I-Application
,	O
then	O
execute	O
the	O
call	O
and	O
wait	O
for	O
it	O
to	O
return	O
,	O
and	O
finally	O
switch	O
back	O
to	O
protected	B-Application
mode	I-Application
.	O
</s>
<s>
Code	O
that	O
runs	O
in	O
real	B-Application
mode	I-Application
(	O
including	O
the	O
BIOS	B-Operating_System
)	O
is	O
limited	O
to	O
accessing	O
just	O
over	O
1	O
MiB	O
of	O
memory	O
,	O
due	O
to	O
using	O
16-bit	O
segmented	O
memory	O
addressing	O
.	O
</s>
<s>
Additionally	O
,	O
the	O
BIOS	B-Operating_System
is	O
generally	O
not	O
the	O
fastest	O
way	O
to	O
carry	O
out	O
any	O
particular	O
task	O
.	O
</s>
<s>
In	O
fact	O
,	O
the	O
speed	O
limitations	O
of	O
the	O
BIOS	B-Operating_System
made	O
it	O
common	O
even	O
in	O
the	O
DOS	B-Device
era	O
for	O
programs	O
to	O
circumvent	O
it	O
in	O
order	O
to	O
avoid	O
its	O
performance	O
limitations	O
,	O
especially	O
for	O
video	O
graphics	O
display	O
and	O
fast	O
serial	O
communication	O
.	O
</s>
<s>
Beyond	O
the	O
above	O
factors	O
,	O
problems	O
with	O
BIOS	B-Operating_System
functionality	O
include	O
limitations	O
in	O
the	O
range	O
of	O
functions	O
defined	O
,	O
inconsistency	O
in	O
the	O
subsets	O
of	O
those	O
functions	O
supported	O
on	O
different	O
computers	O
,	O
and	O
variations	O
in	O
the	O
quality	O
of	O
BIOSes	O
(	O
i.e.	O
</s>
<s>
By	O
taking	O
matters	O
into	O
their	O
own	O
hands	O
and	O
avoiding	O
reliance	O
on	O
BIOS	B-Operating_System
,	O
operating	B-General_Concept
system	I-General_Concept
developers	O
can	O
eliminate	O
some	O
of	O
the	O
risks	O
and	O
complications	O
they	O
face	O
in	O
writing	O
and	O
supporting	O
system	O
software	O
.	O
</s>
<s>
On	O
the	O
other	O
hand	O
,	O
by	O
doing	O
so	O
those	O
developers	O
become	O
responsible	O
for	O
providing	O
"	O
bare-metal	O
"	O
driver	B-Application
software	I-Application
for	O
every	O
different	O
system	O
or	O
peripheral	O
device	O
they	O
intend	O
for	O
their	O
operating	B-General_Concept
system	I-General_Concept
to	O
work	O
with	O
(	O
or	O
for	O
inducing	O
the	O
hardware	O
producers	O
to	O
provide	O
those	O
drivers	B-Application
)	O
.	O
</s>
<s>
Thus	O
it	O
should	O
be	O
apparent	O
that	O
compact	O
operating	B-General_Concept
systems	I-General_Concept
developed	O
on	O
small	O
budgets	O
would	O
tend	O
to	O
use	O
BIOS	B-Operating_System
heavily	O
,	O
while	O
large	O
operating	B-General_Concept
systems	I-General_Concept
built	O
by	O
huge	O
groups	O
of	O
software	O
engineers	O
with	O
large	O
budgets	O
would	O
more	O
often	O
opt	O
to	O
write	O
their	O
own	O
drivers	B-Application
instead	O
of	O
using	O
BIOSthat	O
is	O
,	O
even	O
without	O
considering	O
the	O
compatibility	O
problems	O
of	O
BIOS	B-Operating_System
and	O
protected	B-Application
mode	I-Application
.	O
</s>
