Developing a minimal kernel with testing environment Starting Point Goals Development Results Hüseyin Uslu.

Slides:



Advertisements
Similar presentations
CP1610: Introduction to Computer Components
Advertisements

计算机系 信息处理实验室 Lecture 3 System Mechanisms (1)
Interacting with X86 hardware devices by Istvan Haller.
PC bootup Presented by: Rahul Garg (2003CS10183) Rajat Sahni (2003CS10184) Varun Gulshan(2003CS10191)
The ATA/IDE Interface Can we write a character-mode device driver for the hard disk?
Genesis: from raw hardware to processes System booting sequence: how does a machine come into life.
The power supply performs a self-test. When all voltages and current levels are acceptable, the supply indicates that the power is stable and sends the.
Operating System Structure
Interrupts What is an interrupt? What does an interrupt do to the “flow of control” Interrupts used to overlap computation & I/O – Examples would be console.
Exceptions and Interrupts How does Linux handle service- requests from the cpu and from the peripheral devices?
LOGO Chapter 1 Interrupt handling. hardware interrupt Under x86, hardware interrupts are called IRQ's. When the CPU receives an interrupt, it stops whatever.
Figure 2.8 Compiler phases Compiling. Figure 2.9 Object module Linking.
OS Fall ’ 02 Introduction Operating Systems Fall 2002.
Wednesday, June 07, 2006 “Unix is user friendly … it’s just picky about it’s friends”. - Anonymous.
EET 450 Chapter 2 – How hardware and Software Work Together.
System initialisation
Build an Operating System
PS/2 Keyboard USB Ports Serial Port VGA Port Speakers Line In Microphone PS/2 Mouse RJ-45(Ethernet) LPT1 (Parallel) Game Port (Joystick)
Introduction Purpose Objectives Content Learning Time
MDK-ARM Microcontroller Development Kit MDK: Microcontroller Development Kit.
General System Architecture and I/O.  I/O devices and the CPU can execute concurrently.  Each device controller is in charge of a particular device.
Computer Startup Sequence Overview
Linux Booting Procedure
Lab3 for I/O TA: 黃俊輔 jojoman
The Basic Input/Output System Unit objectives: Access the BIOS setup utility, change hardware configuration values, and research BIOS updates Explain the.
Understanding and Troubleshooting Your PC. Chapter 5: Understanding, Installing, and Troubleshooting Disk Drives2 Chapter Objectives  In this chapter,
How Hardware and Software Work Together
Linux Kernel 101 Sriram Sundararajan. Linux : /lee'nuhks/ or /li'nuks/, not /li:'nuhks/ n. /lee'nuhks/ or /li'nuks/, not /li:'nuhks/ n. The free Unix.
Recall: Three I/O Methods Synchronous: Wait for I/O operation to complete. Asynchronous: Post I/O request and switch to other work. DMA (Direct Memory.
Laface Operating System Design Booting a PC to run a kernel from Low memory VGA display.
Making MINT64OS Chan Seok Kang 2013/01/21. 2Computer Systems and Platforms Lab Content Introduction My Approach Encountered Problem Conclusion & Future.
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)
Basic Input/Output System
CSNB374: Microprocessor Systems Chapter 5: Procedures and Interrupts.
Interrupt driven I/O. MIPS RISC Exception Mechanism The processor operates in The processor operates in user mode user mode kernel mode kernel mode Access.
University of Pennsylvania 9/12/00CSE 3801 Processes, Interrupts, and System Calls CSE 380 Lecture Note 2 Insup Lee.
We will focus on operating system concepts What does it do? How is it implemented? Apply to Windows, Linux, Unix, Solaris, Mac OS X. Will discuss differences.
Advanced x86: BIOS and System Management Mode Internals Boot Process Xeno Kovah && Corey Kallenberg LegbaCore, LLC.
CIS250 OPERATING SYSTEMS Chapter One Introduction.
June 16, 2002 SPC Tutorial 1 Washington WASHINGTON UNIVERSITY IN ST LOUIS A Smart Port Card (SPC and SPC-II) Tutorial --- Hardware John DeHart Washington.
Chapter 8: Installing Linux The Complete Guide To Linux System Administration.
7. IRQ and PIC ENGI 3655 Lab Sessions. Richard Khoury2 Textbook Readings  Interrupts ◦ Section
Interrupt driven I/O Computer Organization and Assembly Language: Module 12.
OSes: 2. Structs 1 Operating Systems v Objective –to give a (selective) overview of computer system architectures Certificate Program in Software Development.
10. Epilogue ENGI 3655 Lab Sessions.  We took control of the computer as early as possible, right after the end of the BIOS  Our multi-stage bootloader.
PC Maintenance: Preparing for A+ Certification Chapter 14: Configuring Devices in Windows.
What You Need to Know for Project One Joey Echeverria Friday, August 29, Fall 2003.
Information Security - 2. Task Switching Every process has an associated Task State Segment, whose starting point is stored in the Task register. A task.
January 8, 2001 SPC Tutorial 1 Washington WASHINGTON UNIVERSITY IN ST LOUIS Agenda 9:00 SPC Hardware -- John DeHart 9:45 SPC Software -- John DeHart 10:30.
Interrupts and Exception Handling. Execution We are quite aware of the Fetch, Execute process of the control unit of the CPU –Fetch and instruction as.
Embedded Real-Time Systems Introduction to embedded software development Lecturer Department University.
Chap. 4 ARM Boot Loader Internals. 2 S3C2500 ARM940T Core module ARM9TDMI CoreIC.
© D. J. Foreman, Structure of an O/S. © D. J. Foreman, Overview  Required functionality –Handle interrupts –Manage resources Processes.
Tech Level Cyber Security
Parts of a Computer.
Homework Reading Machine Projects Labs
An Interrupt is either a Hardware generated CALL (externally derived from a hardware signal) OR A Software-generated CALL (internally derived from.
Interrupts and exceptions
Chapter Objectives In this chapter, you will learn:
Interfacing with Hardware
Anton Burtsev February, 2017
SAPC Hardware Pentium CPU (or 486) 4M usable memory
COMPUTER PERIPHERALS AND INTERFACES
CNET 315 Microprocessor & Assembly Language
1.00 Examine the role of hardware and software.
Computer Startup.
TPM, UEFI, Trusted Boot, Secure Boot
Interrupts and System Calls
Presentation transcript:

Developing a minimal kernel with testing environment Starting Point Goals Development Results Hüseyin Uslu

Starting point ► Fast developing technology ► Many alternatives ► Users always expecting more and more performance Benchmark Software

Goals Hardware Performance Tests ► CPU  Floating Point  Processing Capacity ► Memory  Access Time  Corrupt Memory Banks ► Disc ► etc.

Need for a kernel ► Effect of a operating system on performance tests  Services  Drivers  Processes ► Ensure equal conditions for similar configured computers ► Enabling direct access of performance analyse codes to hardware  Ring0  Getting rid of operating system limitations Benchmark Software based on a kernel

Test Environment ► Kernel based platform for performance analysis code ► No installation (live cd, USB sticks) ► Parameter based tests ► While a performance test, only vital kernel code runs ► While a performance test, user input is blocked

Development Environment ► Concurrent Development: Subversion ► Compilers: GCC, NASM ► Make system: MAKE ► Debugger: GDB ► Emulator: bochs, qemu, vmware ► Bootloader: GRUB

Boot Loader GNU GRUB  Stable  Widely used  Supports different boot options ► CD ► Floppy ► USB drive

Bootloader - 2 ► boot.S (GRUB Multiboot Specification ) ► kernel.c - main(), entrance point for kernel

GDT Global Descriptor Table (gtd.c)  Memory Segments  Access Privileges (ring0) gdt_flush.asm  kernel.c -> install_gdt() -> gdt_flush() [lgdt]

IDT Interrupt Descriptor Tables  Interrupts  Exceptions idt.c  ISR definitions (ISR0 – ISR31)  IRQ definitions (IRQ0, IRQ1…) kernel.c-> install_idt()  Relocating ISR & IRQs  Matching handler fuctions for ISR & IRQs  load_idt() [lidt]

Reprogramming the PIC ► CPU Exceptions  > interrupt table ► PIC ( hardware IRQs )  Master (IRQ0 – IRQ7) -> interrupt table  Slave (IRQ8 – IRQ15) -> interrupt table ► Interrupt Table, location 8  Double Fault Exception  IRQ0, timer interrupt ► Need reprogramming [pic.c – remap_pics()]  0 Division By Zero Exception  1 Debug Exception  …  7 No Coprocessor Exception  8 Double Fault Exception  9 Coprocessor Segment Overrun Exception  10 Bad TSS Exception ..  31 Reserved Exception  32 IRQ0 Timer  33 IRQ1 Keyboard  …  39 IRQ7 Parallel Port  …  47 IRQ15 Secondary IDE channel

Interrupt Handlers ► Handler functions (irq_handler.c)  Timer [timer_handler()]  Keyboard [keyboard_handler()]

Exception Handlers ► exception.c  Fires on a CPU exception ► Name of exception ► Error code ► System status ► Register status ► Code Segment: Instruction Point (CS:IP)

Finding CPU (CPUID) ► cpuid.asm, cpu_info.asm  CPU Brand  CPU Vendor  CPU Features

Console Driver ► User I/O (console.c, keyboard.c)  User input  Test results, reports

Timer ► PIT [irq_handler.c, timer_handler()] ► Realtime Clock (RTC) [time.c, read_system_time() ]  Read current value from CMOS ► Stop Timer [ start_time(), stop_time()  Stop timer for performance analysis – 1ms sensivity

SMBIOS ► Basic SMBIOS support [ smbios.c, read_smbios() ]  Searches 000F0000h-000FFFFFh for SMBIOS signature  Basic BIOS, system, motherboard info ► Ongoing development

Makefile targets ► Make  Compile & link sources ► Make image  Disk image with GRUB ► Make iso  ISO image

Documentation ► /doc folder under Subversion Repo.  PIC, PIT, RTC…  Compiling, Development Environment  Technical topics, specifications

Result ► Bootstrap ► Vital kernel functions ► Base platform for performance analysis