2 DOS and BIOS Interrupts by DMK

Embed Size (px)

Citation preview

  • 8/3/2019 2 DOS and BIOS Interrupts by DMK

    1/10

    DOS and BIOS

    Interrupts

    D. Murali Krishna

    ECE,SVECW.

  • 8/3/2019 2 DOS and BIOS Interrupts by DMK

    2/10

    Introduction In IBM PC, Part of the Operating systems is located in permanent

    memory (ROM), it is referred as ROM-BIOS (Basic Input/OutputSystem).

    The other part which is loaded to the RAM during Power-up from

    hard disk is known as DOS (Disk Operating System).

  • 8/3/2019 2 DOS and BIOS Interrupts by DMK

    3/10

    BIOS:

    It is located in an 8K-byte ROM at the top of memory, the

    address range from FE000H FFFFFH. The program within ROM-BIOS provide the most direct,

    lowest interaction with various devices in the system.

    ROM-BIOS contains routines for

    1. Power-on self test2. System Configuration analysis

    3. Time of day

    4. Print Screen

    5. Bootstrap Loader

    6. I/O support program fora. Asynchronous Communication

    b. Keyboard

    c. Diskette

    d. Printer

    e. Display

  • 8/3/2019 2 DOS and BIOS Interrupts by DMK

    4/10

    Most of these programs are accessible to the assembly language

    programmer through software interrupt instruction (INT).

    Design goal for the ROM-BIOS programs is to provide a device-

    independent interface to the various physical devices in the

    system.

    Using ROM-BIOS one can

    Output the character to various physical devices like the printer (or) the

    display monitor. Read the data from key board

    Read or write sectors of data to the diskette

    A few things we cant do using ROM-BIOS

    It is not possible to provide ability to load and execute programs directly

    It is not possible to store data on the diskette organized as logic files.

    ROM-BIOS has no command interpreter to allow us to copy files, print files,

    delete files.

    The DOS will provide these services.

  • 8/3/2019 2 DOS and BIOS Interrupts by DMK

    5/10

    When the computer is turned ON,

    We expect to see a message or a prompt.

    We expect to be able to look at the diskette directory to see what data files

    or programs the diskette contains.

    We expect to run a program by typing its name.

    We want to copy programs from one diskette to another, print

    programs, and delete programs.

    All these services are provided by group of programs called DOS.

  • 8/3/2019 2 DOS and BIOS Interrupts by DMK

    6/10

    The services provided by DOS can be grouped onto followingcategories.

    1) Character Device I/O: This group includes routines that input or output

    characters to character oriented devices such as theprinter, the display monitor, and the keyboard.

    2) File Management: This group includes routines that manage logical files,allowing you to create, read, write and delete files.

    3) Memory Management: This group includes routines that allow us to change,allocate, and deallocate memory.

    4) Directory Management: This group includes routines that permit us to create,change search, and delete directories.

    5) Executive Functions: This group includes routines that allow us to load andexecute programs, to overlay programs, to retrieve errorcodes from completed programs, and to executecommands.

    6) Command Interpreter: This routine is in action whenever a prompt is presenton the screen. It interprets commands and executesDOS functions, utility programs, application programs,depending upon the command.

    7) Utility Programs: These programs facility to copy, delete provides the

    DISKCOPY, DIR and many other DOS commands.

  • 8/3/2019 2 DOS and BIOS Interrupts by DMK

    7/10

    Comparison b/w DOS and ROM-BIOS

    DOS

    1. It is loaded form the bootable

    diskette.

    2. DOS program offer different

    degree of flexibility, portability,

    and hardware independence

    3. It has ability to load and execute

    programs directly

    4. DOS can store data on the

    diskette organized as a logical

    files.

    5. DOS has a command-interpreter

    to allow us to copy files, printfiles and delete files.

    BIOS

    1. It is located in an 8K byte ROM

    2. The programs within the ROM-BIOS provide the most direct,lowest level interaction with thevarious devices in the system.Using these programs requirehardware knowledge.

    3. ROM-BIOS does not have abilityto load and execute programsdirectly.

    4. ROM-BIOS cannot store data onthe diskette organized as alogical files

    5. ROM-BIOS has no command-interpreter to allow us to copyfiles, print files, and delete files.

  • 8/3/2019 2 DOS and BIOS Interrupts by DMK

    8/10

    DOS Interrupts:Function Call 01: Read the keyboard

    Input parameter : AH=01

    Function : Read a character from keyboard. Echo it on CRT screen and return the

    ASCII code of key pressed in Register AL. Output parameter : AL=ASCII code of character

    Function Call 02: Display on CRT screen

    Input Parameter : AH=02

    DL= ASCII code of character to be displayed on CRT screen

    Function : Displays the character available in DL on CRT screen.

    Function Call 03: Read character from COM1 (Communication port1)

    Input parameter : AH=03

    Function : Reads data from communication port

    Output parameter : AL=ASCII code of character

    Function Call 04: Write character to COM1

    Input parameter : AH=04

    DL=ASCII code of character to be transmitted.

    Function : Transmit data through communication port

    Function Call 05: Write to LPT1 (Line printer 1)

    Input parameter : AH=05

    DL=ASCII code of character to be printed

    Function : Print the character available in DL on printer attached to LPT1

  • 8/3/2019 2 DOS and BIOS Interrupts by DMK

    9/10

    Function Call 09: Display a character string

    Input parameter: AH=09, DS:DX = Address of character string

    Function:

    Displays the characters available in the string on CRT screen. It continues prints till a $(ie.,24H) encountered

    So string must end with a $

    String can contain control characters also

    The Length of the string can by any

    Function Call 0AH: Buffered key board input

    Input parameter: AH=0AH

    DS:DX = Address of keyboard input buffer

    Function:

    First byte of buffer = Size of buffer up to 255.

    The ASCII codes of characters received from the keyboard are stored in keyboard bufferstarting from third byte onwards.

    It will continue to receive the characters till specified number of characters are received

    (or) ENTER key is pressed, which ever is earlier.

    Output Parameter:

    Second byte of buffer contain the count of actual number of character received.

  • 8/3/2019 2 DOS and BIOS Interrupts by DMK

    10/10