BBB
Typical components of the Kernel are:
interrupt handlers to service interrupt requests, a scheduler to share processor time among multiple processes, a memory management system to manage process address spaces, and system services such as networking and interprocess communication.
kernel
is a computer program at the core of a computer's operating system with complete control over everything in the system.
Interrupt vector table
is a data structure that associates a list of interrupt handlers with a list of interrupt requests in a table of interrupt vectors. Each entry of the interrupt vector table, called an interrupt vector, is the address of an interrupt handler.
Run-Time stack
is a memory array managed directly by the CPU, using the ESP (extended stack pointer) register, known as the stack pointer register. In 32-bit mode, ESP register holds a 32-bit offset into some location on the stack.
Subroutine
is a sequence of program instructions that performs a specific task, packaged as a unit.
Operating System
program that manages a computer's hardware. It also provides a basis for application programs and acts as an intermediary between the computer user and the computer hardware.
Calling Standard Library Routines
MASM allows you to call standard C library routines like other standard functions: •Need to declare them as "extern" •Need to use the "_" prefix
They leave a portion of their code in memory when they exit; these are called
Memory-resident programs, or terminate and stay resident (TSR) programs.
In real-address mode,
Only 1 MByte of memory can be addressed, from hexadecimal 00000 to FFFFF. The processor can run only one program at a time, but it can momentarily interrupt this program to process requests (called interrupts) from peripherals. Application programs are permitted to access any memory location, including addresses that are linked directly to systemhardware. The MS-DOS operating system runs in real-address mode, and Windows 95 and 98can be booted into this mode.
AVX (Advanced Vector Extension)
"second generation" of the Intel Core processors (Core i7, i5, i3) 2012 Adds new registers, data types and instructions to the x86 platform Introduces a modern three-operand assembly language instruction syntax that helps to improve performance Fused multiply-adding operations Non-Destructive source operands The operand is not modified during instruction execution Packed 128-Bit, Packed 128-bit, 256-bit floating point Packed 512-bit integer and floating point 8 New registers YMM0-YMM7 XMM: 128-Bits & YMM: 256 Bits
Packed data types
- are employed to perform SIMD calculations using either integers or floating-point values.
Instruction Pointer (EIP)
- contains the offset of the next instruction to be executed. - manipulated by control-transfer instructions
What are the 4 different programming levels?
3- Library 2- OS 1-BIOS 0-Hardware
•There are eight 16-bit "general purpose" registers :
AX, BX, CX, DX, EX, SI, DI, BP, and SP, overlapping with a pair of 8-bit registers:
EFI
Extensible Firmware Interface - transfer an executable using multiboot -Loads an ELF(Executable and Linkable Format) executable -Has special flags and magic number : 0x1BADB002 -Located in the first 8KN of memory
(True/False): Local variables are created by adding a positive value to the stack pointer.
FALSE
Interrupt Descriptor Table
It is the Protected mode counterpart to the Real Mode Interrupt Vector Table (IVT) telling where the Interrupt Service Routines (ISR) are located (one per interrupt vector)
PC Bios
Basic Input Output System - Stored in EEPROM
Instruction Operands
Designate the specific values that an instruction will act upon. There are three basic types of operands: immediate, register, and memory.
When an interrupt happens
EFLAG,CS and EIP will be spilled out
Firmware
ROM or EEPROM with Bootstrap/ permanent software programmed into a read-only memory.
(True/False): A subroutine's prologue code always pushes EBP on the stack.
TRUE
(True/False): A subroutine's stack frame always contains the caller's return address and the subroutine's local variables.
TRUE
(True/False): Arrays are passed by reference to avoid copying them onto the stack.
TRUE
(True/False): In 32-bit mode, the last argument to be pushed on the stack in a subroutine call is stored at location EBP + 8.
TRUE
(True/False): Passing by reference means that an argument's address is stored on the run- time stack.
TRUE
In virtual-8086 mode,
The computer runs in protected mode and creates a virtual-8086 machine with its own 1-MByte address space that simulates an 80x86 computer running in real-address mode. Windows NT and 2000, for example, create a virtual-8086 machine when you open a Command window. You can run many such windows at the same time, and each is protected from the actions of the others. Some MS-DOS programs that make direct references to computer hardware will not run in this mode under Windows NT, 2000, and XP.
Global Descriptor Table
The global descriptor table (GDT) holds the memory protection configuration for the protected mode for the processor. The GDT is a table, which must be allocated from contiguous memory.
What is meant by the naming convention used by a language?
The naming convention used by a language refers to the rules or characteristics regarding the naming of variables and procedures.
In protected mode,
The processor can run multiple programs at the same time. It assigns each process (running program) a total of 4 GByte of memory. Each program can be assigned its own reserved memory area, and programs are prevented from accidentally accessing each other's code and data. MS-Windows and Linux run in protected mode.
General-Purpose Registers
These registers are primarily used to perform logical, arithmetic, and address calculations.
What are the two common types of stack parameters?
Value parameters and Reference parameters
Task state segment (TSS)
holds information about a task. It is used by the operating system kernel for task management.
Hardware interrupts
are generated by external hardware events
Software interrupts
are generated by programs running on the system executing the "INT" instruction.
Bootstrap Program
are made up of hardware, the operating system, the application programs,and the users
In cdecl, subroutine arguments are
are passed on the stack. Integer values and memory addresses are returned in the EAX register
Device drivers
are programs that permit the operating system to communicate directly with hardware devices and the system BIOS. For example, a device driver might receive a request from the OS to read some data; the device driver satisfies the request by executing code in the device firmware that reads data in a way that is unique to the device. Device drivers are usually installed in one of two ways: (1) before a specific hardware device is attached to a com-puter, or (2) after a device has been attached and identified.
EFLAGS Register
contains a series of status bits that the processor uses to indicate the results of logical and arithmetic operations.
The "multiboot"
standard has become the standard executable format for modern PC's. The typical boot-up sequence is that the computer's on-board EFI BIOS can directly boot a multiboot executable, or can load a boot utility, such as the "Grand Unified Boot Loader" (a.k.a GRUB). Our first step is to write a multiboot image that can print the letters "hello world" on a PC console.
Modes of Operation
three primary modes of operation: real-address mode virtual-8086 mode protected mode
Segment registers
to define a logical memory model for program execution and data storage.
Interrupts
which are defined as asynchronous events that are generated by external devices to get the attention of the system. Examples include typing a key on the keyboard or the arrival of a network packet on a controller.
Exceptions
which are defined as synchronous events generated as a result of the failure to execute an instruction. Examples include division by zero, accessing an illegal memory address, or attempting to execute a privileged instruction
There are several important uses of runtime stacks in programs:
•A stack makes a convenient temporary save area for registers when they are used for more than one purpose. After they are modified, they can be restored to their original values. •When the CALL instruction executes, the CPU saves the current subroutine's return address on the stack. •When calling a subroutine, you pass input values called arguments by pushing them on the stack. •The stack provides temporary storage for local variables inside subroutines
•X86-32 contains six segment registers - holdover from original x86
•CS - Code Segment ES - Extra Segment •DS - Data Segment FS - Programmer defined •SS - Stack Segment GS - Programmer defined
There are three basic types of operands:
•Immediate—uses a numeric literal expression •Register—uses a named register in the CPU •Memory—references a memory location