Understanding POST and ROM-BIOS service functions Numerous low-level services are available to real-mode programs (include boot-loaders)

Slides:



Advertisements
Similar presentations
Hardware Lesson 3 Inside your computer.
Advertisements

Using VMX within Linux We explore the feasibility of executing ROM-BIOS code within the Linux x86_64 kernel.
Basic Computer Hardware and Software.
Crafting a ‘boot time’ program How we can utilize some standard ‘real-mode’ routines that reside in the PC’s ROM-BIOS firmware.
1BA3 G Lacey Lecture 51 Evaluating mathematical expressions  How do computers evaluate x + y or any mathematical expression ?  Answer : “Reverse Polish.
Basic Input Output System
Using data conversions
Set 20 Interrupts. INTERRUPTS The Pentium has a mechanism whereby external devices can interrupt it. Devices such as the keyboard, the monitor, hard disks.
11/13/01CS-550 Presentation - Overview of Microsoft disk operating system. 1 An Overview of Microsoft Disk Operating System.
Defining protected-mode segment-descriptors An example of a protected-mode bootsector application that draws a message to the video display.
LOGO Chapter 1 Interrupt handling. hardware interrupt Under x86, hardware interrupts are called IRQ's. When the CPU receives an interrupt, it stops whatever.
1 Hardware and Software Architecture Chapter 2 n The Intel Processor Architecture n History of PC Memory Usage (Real Mode)
Architectural Support for Operating Systems. Announcements Most office hours are finalized Assignments up every Wednesday, due next week CS 415 section.
EET 450 Chapter 2 – How hardware and Software Work Together.
CS2422 Assembly Language & System Programming November 2, 2006.
Graphics Bitmaps Drawing characters glyphs and multicolor patterns.
Introduction to Interrupts
The Microprocessor-based PC System Prima Dewi Purnamasari Microprocessor Electrical Engineering Department University of Indonesia.
Group #5 1. Mereseini Rokodau 2. Eleanor Siavii 3. Jowella Vaka.
CS 0008 Day 2 1. Today Hardware and Software How computers store data How a program works Operators, types, input Print function Running the debugger.
V Material obtained from summer workshop in Guildford County.
Input/Output. Input/Output Problems Wide variety of peripherals —Delivering different amounts of data —At different speeds —In different formats All slower.
How Hardware and Software Work Together
Chapter 5 Basic Input/Output System (BIOS)
Basic Input Output System
Linux Booting Procedure
Lesson 3 — How a Computer Processes Data
Computer Maintenance Unit Subtitle: Basic Input/Output System (BIOS) Excerpted from 1 Copyright © Texas Education Agency, All.
Interrupts. What Are Interrupts? Interrupts alter a program’s flow of control  Behavior is similar to a procedure call »Some significant differences.
Learning Targets Identify the external parts of the computer Identify examples of input devices Identify examples of output devices Define basic computer.
Chapter Two Hardware Basics: Inside the Box. ©1999 Addison Wesley Longman2.2 Chapter Outline What Computers Do A Bit About Bits The Computer’s Core: CPU.
MAC OS – Unit A Page: 10-11, Investigating Data Processing Understanding Memory.
Computer Terms.
Copyright © 2003 by Prentice Hall Module 5 Central Processing Unit 1. Binary representation of data 2. The components of the CPU 3. CPU and Instruction.
© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems Principles of I/0 hardware.
1 Introduction Chapter 1 n What is Assembly Language? n Data Representation.
Hardware Data Storage.
Chapter 2 Instruction Addressing and Execution. Lesson plan Review some concepts in the first week First assembly program with EMU8086 Related concepts.
Inside your computer. Hardware Review Motherboard Processor / CPU Bus Bios chip Memory Hard drive Video Card Sound Card Monitor/printer Ports.
1. Stage-1 Bootloader ENGI 3655 Lab Sessions Richard Khoury.
GCSE Information Technology Computer Systems 2 Hardware is the name that is given to any part of a computer that you can actually touch. An individual.
Virtual Memory Review Goal: give illusion of a large memory Allow many processes to share single memory Strategy Break physical memory up into blocks (pages)
BIOS Training Eric Chiu AE Dept What is BIOS ? Pronounced "bye-ose," an acronym for Basic Input/Output System. The BIOS is built-in software.
Lesson 3 — How a Computer Processes Data Unit 1 — Computer Basics.
8086 Microprocessor Interrupts By: Vijay Kumar. K Reference From Slide Share.
Basic Input/Output System (BIOS). 5.1Introduction to BIOS Basic Input / Output System (BIOS) boot the computer by providing a basic set of instructions.
Functions/Methods in Assembly
Feb/18/2014 Mazen Alzyoud Early Term Exam Review.
The Computer System.
Input/Output Problems Wide variety of peripherals —Delivering different amounts of data —At different speeds —In different formats All slower than CPU.
Computer Maintenance I
Basic Computer Hardware and Software. Guilford County SciVis V
Memory The term memory is referred to computer’s main memory, or RAM (Random Access Memory). RAM is the location where data and programs are stored (temporarily),
Lesson 2 Component Overview Core Hardware Fundamentals.
1 Device Controller I/O units typically consist of A mechanical component: the device itself An electronic component: the device controller or adapter.
Basic Computer Hardware and Software.
Computer Basics Just How Does a Computer Work?
IC 3 BASICS, Internet and Computing Core Certification Computing Fundamentals Lesson 2 How Does a Computer Process Data?
Embedded Real-Time Systems Processing interrupts Lecturer Department University.
PCs ENVIRONMENT and PERIPHERALS Lecture 3. operating system and other system software that control the usage of the computer equipment application programs.
7-Nov Fall 2001: copyright ©T. Pearce, D. Hutchinson, L. Marshall Oct lecture23-24-hll-interrupts 1 High Level Language vs. Assembly.
Chapter 2 Instruction Addressing and Execution. Lesson plan Review some concepts in the first week First assembly program with EMU8086 Related concepts.
Information Technology (IT). Information Technology – technology used to create, store, exchange, and use information in its various forms (business data,
IT Chapter 2 Part A How Computers Work Input, process, output, and storage The operating system helps the computer perform four basic operations,
Computer Maintenance Unit Subtitle: Basic Input/Output System (BIOS)
Storage Hardware This icon indicates the slide contains activities created in Flash. These activities are not editable. For more detailed instructions,
Introduction to Computer Programming
Computer Architecture and Assembly Language
Presentation transcript:

Understanding POST and ROM-BIOS service functions Numerous low-level services are available to real-mode programs (include boot-loaders)

Power-On Self-Test (POST) When computer is first turned on, the CPU starts executing instructions in ROM-BIOS Reset-address: CS=0xF000, EIP=0xFFF0 Initial routines perform vital functions: –Verify amount of installed read/write memory –Setup the table of real-mode interrupt-vectors –Detect and initialize the peripheral equipment –Setup parameters in the BIOS DATA AREA Read in, and transfer to, the ‘boot-loader’

Memory Layout during POST RAM 1MB ROM-BIOS VRAM RAM ROM-BIOS VRAM IVT BIOS DATA Beginning… Boot-loader …Finished The POST creates the Interrupt Vector Table and fills in parameters of the Bios Data area POST finishes up by reading in the boot-loader from a storage device

Two demo-programs The program ‘showivt.cpp’ lets you look at the table of (real-mode) interrupt vectors (addresses 0x to 0x ) The program ‘showrbda.cpp’ lets you see the parameter-values that the ROM-BIOS has stored in its ROM-BIOS DATA-AREA (addresses 0x to 0x ) A special device-driver (named ‘dos.o’) is needed for accessing these memory areas

ROM-BIOS service-functions During POST, the startup routines need to use various low-level system-services: –To show diagnostic messages on the display –To accept keystroke-commands from a user –To query the real-time clock/calendar device –To optionally send important data to a printer –To read in a data-sector from the boot device The actions are performed as subroutines

Space in ROM is ‘tight’ Size of a typical ROM-BIOS chip is 64KB Needs to store the instructions and data for several hundred different functions So cannot afford to waste precious space Routines are written in assembly language Clever coding is used to optimize storage usage (e.g., ROM functions get invoked by software-interrupt instructions (2-bytes) as an alternative to subroutine-calls (3-bytes)

Services remain available All of the low-level ROM-BIOS services remain available to Real-Mode programs This includes ‘boot-loader’ programs If we’re going to write our own boot-loader, we will benefit by knowing what low-level services are already available in ROM (as we will face tight space limitations, too: namely, the 512-byte disk sector-size)

Catalog of ROM-BIOS services int 0x10: video display services int 0x11: equipment-list service int 0x12: memory-size service int 0x13: disk input/output services int 0x14: serial communications services int 0x15: system software services

ROM-BIOS services (continued) int 0x16: keyboard input/control services int 0x17: parallel-port printer services int 0x18: diskless bootstrap service int 0x19: system reboot service int 0x1A: real-time clock services

Example: Get Memory Size When it’s time to load an operating system the ‘OS-loader’ will need to know where it can place the OS code and data so as to efficiently fit within the system’s memory So the question will be: How much actual ram is available? One of the simplest ROM-BIOS services can be invoked to get the answer.

Calling ‘Get Memory Size’ No service-parameters are required Just execute an ‘int 0x12’ instruction Size of the available ram is returned in AX (expressed in kilobytes: 1KB=1024 bytes) Program-code looks like this: int 0x12; call BIOS service mov kb_ram, ax; save return-value

How does it work? Executing ‘int 0x12’ transfers control to an Interrupt Service Routine within the ROM The CPU gets the entry-point for this ISR from the Interrupt Vector Table (IVT) The IVT has enough room for 256 ‘vectors’ (all vectors use a doubleword of storage) The number 0x12 is an array-index for IVT Example: vector 0x12 equals 0xF000F841

Here’s the ISR’s code isr_0x12: push ds; preseve DS mov ax, #0x40; address BD area mov ds, ax; using DS register mov ax, [0x0013]; get POST param pop ds; restore DS iret; return from ISR

Demo Program: ‘memsize.s’ We wrote a simple boot-sector program to illustrate the ‘Get Memory Size’ service It executes ‘int 0x12’ to obtain the amount of usable real-mode memory (in kilobytes) It converts the binary value obtained in AX to its decimal representation as a string of ascii characters, and ‘int 0x10’ functions to display the information in readable form

In-Class Exercise #1 Write a similar boot-sector demo program that will display the Equipment-Check List (a bitmap showing some installed devices that’s returned in AX if ‘int 0x11’ executes) You can look at our ‘showmsw.s’ demo as a guide to writing your assembler code

Equipment List Bitmap Diskette available for booting (1=yes, 0=no) External math-coprocessor installed (1=yes, 0=no) PS/2-type pointing-device is installed (1=yes, 0=no) Initial video-display mode (11=80x25 monochrome, 10=80x25 color, 01=40x25 color, 00=EGA/VGA/SVGA) Number of diskette drives (if bit 0 is set) (00=1 drive, 01=2 drives, etc) Number of serial-ports Number of printer-ports Internal modem (1=yes, 0=no)

In-Class Exercice #2 Enhance the ‘showmem.s’ demo-program by showing additional information about the amount of physical memory installed: use ROM-BIOS system-services int 0x15 function 0xE8, subfunction 0x01 (see Ralf Brown’s online Interrupt-List for details)

Extended Memory Areas 8086 memory-area (1MB) memory-area (16MB) Pentium’s Memory-area (4GB) Number of 64KB blocks Is reported by ROM-BIOS (in register BX) Number of 1KB blocks Is reported by ROM-BIOS (in register AX) mov ax, #0xE801 int 0x15