CS401 - Short Notes Chapter 15 PDF
CS401 - Short Notes Chapter 15 PDF
COM
CS401-ASSEMBLY LANGUAGE AND PROGRAMMING
CS401 CHAPTER NO 15 (LECTURE 39-43)
PREPARED BY: HTTPS://SUPERSTARWEBTECH.BLOGSPOT.COM/
The 32-bit base in both descriptors is scattered into different places because of compatibility
reasons.
The limit is stored in 20 bits but the G bit defines that the limit is in terms of bytes of 4K pages
therefore a maximum of 4GB size is possible.
The P bit must be set to signal that this segment is present in memory.
DPL is the descriptor privilege level again related to the protection levels in 386.
D bit defines that this segment is to execute code is 16-bit mode or 32bit mode.
C is conforming bit.
R signals that the segment is readable.
A bit is automatically set whenever the segment is accessed.
The combination of S (system) and X (executable) tell that the descriptor is a code or a data
descriptor.
B (big) bit tells that if this data segment is used as stack SP or ESP is used.
VESA and VBE:
VESA is the Video Electronics Standards Association and VBE is the set of Video BIOS Extensions
proposed by them. The VESA VBE 2.0 standard includes a linear frame buffer mode. This mode
allows direct access to the whole video memory.
Some important VESA services are listed below:
INT 10 – VESA – Get SuperVGA Information
AX = 4F00h
ES:DI -> buffer for SuperVGA information
Return:
AL = 4Fh if function supported
AH = status
INT 10 – VESA – Get SuperVGA Mode Information
AX = 4F01h
CX = SuperVGA video mode
ES:DI -> 256-byte buffer for mode information
Return:
AL = 4Fh if function supported
AH = status
ES:DI filled if no error
INT 10 – VESA – Set VESA Video Mode
AX = 4F02h
BX = new video mode
Return:
AL = 4Fh if function supported
AH = status
VESA mode 4117:
One of the VESA defined modes is 4117 which is a 1024x768 mode with 16-bit color and a linear
frame buffer. The 16 color bits for every pixel are organized in 5:6:5 format with 5 bits for red, 6
for green, and 5 for blue. This makes 32 shades of red and blue and 64 shades of green and 64K
total possible colors. The 32-bit linear frame buffer base address is available at offset 28 in the
mode information buffer.
INTERRUPT HANDLING
Handling interrupts in protected mode is also different. Instead of the IVT at physical address 0
there is the IDT (interrupt descriptor table) located at physical address stored in IDTR, a special
purpose register.
IDTR:
The IDTR is also a 48-bit register similar in structure to the GDTR and loaded with another
special instruction LGDT.
The format of the interrupt descriptor is as shown below:
The P and DPL have the same meaning as in data and code descriptors.
The S bit tells that this is a system descriptor while the 1110 following it tells that it is a 386-
interrupt gate.