Microkernel Construction

Size: px
Start display at page:

Download "Microkernel Construction"

Transcription

1 Microkernel Construction Kernel Entry / Exit Nils Asmussen 05/04/ / 45

2 Outline x86 Details Protection Facilities Interrupts and Exceptions Instructions for Entry/Exit Entering NOVA Leaving NOVA 2 / 45

3 Privilege Levels Ring 3 Ring 2 Ring 1 Ring 0 Ring 0 Operating System Kernel Privileged Ring 1 & 2 Operating System Services Unprivileged Ring 3 User-level Applications Unprivileged 3 / 45

4 Protection Facilities Segmentation Mechanism for dividing linear address space into segments Different segment types: code, data, stack,... Segment has base address and limit Mandatory mechanism; cannot be disabled Paging Mechanism for translating linear to physical addresses Splits virt. & phys. address space into same-size pages Per-page access rights (present, writable, user/kernel) Optional; can be turned off (not on x86 64) 4 / 45

5 Logical Address Translation Logical address consists of Segment selector Segment offset CPU uses table indicator in segment selector to access descriptor in GDT/LDT Segment descriptor provides segment base address, segment limit and access rights (checked by CPU) CPU adds segment offset to segment base address to form linear address 5 / 45

6 Logical Address Translation Logical Address: Seg. Selector Seg. Offset Limit Seg. Desc + Segment Linear Address GDT Base Address Linear Address Space 6 / 45

7 Segment Registers CPU provides 6 segment registers for holding selectors CS (code segment) DS (data segment) SS (stack segment) ES, FS, GS (extra data segments) Selector forms visible part Base address, limit and access rights form shadow part 7 / 45

8 Segment Descriptor Base Address (31..24) G D 0 A V L Limit (19..16) Type P DPL 1 1 C R A Base Address (23..16) Base Address (15..0) Segment Limit (15..0) Figure: Code Segment Descriptor 0 G Granularity DPL Descriptor Privilege Level D Default Size (16/32 Bit) C Conforming AVL Available to Programmer R Readable P Present A Accessed 8 / 45

9 Flat Memory Model Hide segmentation mechanism by Setting segment base address to 0 Setting segment limit to 4 GiB Mandatory for x86 64 We need at least 2 segments Code segment Data/Stack segment If kernel/user use different segment base addresses or segment limits, we need 2 additional segments for each 9 / 45

10 Protection Checks CPU checks on instructions and memory references that certain protection conditions hold: Segment limit check Segment type check Privilege level check Restricted procedure entry points Restricted instruction set... CPU raises exception if protection check fails Protection checks in parallel with address translation No big performance penalty 10 / 45

11 Privileged Instructions LGDT LLDT LTR LIDT MOV to CR LMSW CLTS MOV to DR INVD WBINVD INVLPG HLT RDMSR / WRMSR RDPMC / RDTSC CLI / STI 11 / 45

12 Interrupts & Exceptions Forced transfer of execution from currently executing code to interrupt- or exception handler Hardware interrupts occur asynchronously in response to hardware events Exceptions (including software interrupts) occur synchronously to the instruction stream 12 / 45

13 Interrupt & Exception Vectors Vector uniquely identifies source of the interrupt or exception Vectors are used for exceptions Vectors are designated user vectors (e.g., interrupts) Interrupt Descriptor Table (IDT) is table of handler functions for all interrupts and exceptions Setup by OS Hardware is informed about it via LIDT instruction Vector = offset into IDT 13 / 45

14 Interrupt Descriptor Table (IDT) IDTR register: IDT base address IDT limit Gate for Vector n +... Gate for Vector 2 Gate for Vector 1 Gate for Vector 0 14 / 45

15 Restricted Procedure Entry Points: Gates Descriptors to call procedures at different privilege levels Subject to CPL/RPL vs. DPL checking CS and EIP loaded from descriptor Interrupt Gate disables interrupts, Trap Gate doesn t When switching privilege levels, new ESP loaded from TSS TSS contains stack pointers for privilege levels 0, 1 and 2 Kernel updates SP 0 in TSS on every thread switch Interrupt and exception handlers runs current thread s context 15 / 45

16 Interrupt Gate Offset (31..16) P DPL Reserv. Segment Selector Offset (0..15) Selector Offset DPL P Segment Selector for destination code segment Offset to procedure entry point in segment Descriptor privilege level (ignored for HW ints) Segment present flag 16 / 45

17 Exception Types Faults Can be corrected and allow the program to be resumed Processor restores machine state prior to the execution of faulting instruction (CS and EIP point to faulting instruction) Traps Reported immediately after execution of trapping instruction Allow the program to be resumed (CS and EIP point to following instruction) Aborts Are not always reported at the precise location of the exception Do not allow to resume the program Usually report severe hardware errors or inconsistent state 17 / 45

18 Exceptions 0: Divide Error (F) 1: Debug Exception (F/T) 2: Non-maskable Interrupt 3: Breakpoint (T) 4: Overflow (T) 5: Bound Range Exc. (F) 6: Invalid Opcode (F) 7: Device Not Available (F) 8: Double Fault (A) 9: Coproc. Seg. Overr. (F) 10: Invalid TSS (F) 11: Segm. Not Present (F) 12: Stack Segment Fault (F) 13: General Prot. Fault (F) 14: Pagefault (F) 15: reserved 16: FPU Math Fault (F) 17: Alignment Check (F) 18: Machine Check (A) 19: SIMD FP Exception (F) 18 / 45

19 Kernel Stack after Kernel Entry EFLAGS CS EIP SS ESP EFLAGS (Error Code) No Priv. Level Change ESP CS EIP (Error Code) Priv. Level Change 19 / 45

20 Kernel Entry SS ESP EFLAGS CS EIP entry_6: push $6 jmp entry_exc entry_exc: push $0 entry_exc_err: push %ds push %es push %fs push %gs pusha mov %esp, %ebx mov $KSTCK_BEGIN, %esp mov %cr2, %eax mov %eax, 0xc(%ebx) mov %ebx, %eax call exc_handler jmp ret_from_interrupt 20 / 45

21 Kernel Entry SS ESP EFLAGS CS EIP Vector=6 entry_6: push $6 jmp entry_exc entry_exc: push $0 entry_exc_err: push %ds push %es push %fs push %gs pusha mov %esp, %ebx mov $KSTCK_BEGIN, %esp mov %cr2, %eax mov %eax, 0xc(%ebx) mov %ebx, %eax call exc_handler jmp ret_from_interrupt 21 / 45

22 Kernel Entry SS ESP EFLAGS CS EIP Vector=6 Error=0 entry_6: push $6 jmp entry_exc entry_exc: push $0 entry_exc_err: push %ds push %es push %fs push %gs pusha mov %esp, %ebx mov $KSTCK_BEGIN, %esp mov %cr2, %eax mov %eax, 0xc(%ebx) mov %ebx, %eax call exc_handler jmp ret_from_interrupt 22 / 45

23 Kernel Entry SS ESP EFLAGS CS EIP Vector=6 Error=0 DS ES FS GS entry_6: push $6 jmp entry_exc entry_exc: push $0 entry_exc_err: push %ds push %es push %fs push %gs pusha mov %esp, %ebx mov $KSTCK_BEGIN, %esp mov %cr2, %eax mov %eax, 0xc(%ebx) mov %ebx, %eax call exc_handler jmp ret_from_interrupt 23 / 45

24 Kernel Entry SS ESP EFLAGS CS EIP Vector=6 Error=0 DS ES FS GS GPR (eax, ecx, edx, ebx, cr2,... ) entry_6: push $6 jmp entry_exc entry_exc: push $0 entry_exc_err: push %ds push %es push %fs push %gs pusha mov %esp, %ebx mov $KSTCK BEGIN, %esp mov %cr2, %eax mov %eax, 0xc(%ebx) mov %ebx, %eax call exc_handler jmp ret_from_interrupt 24 / 45

25 Kernel Entry SS ESP EFLAGS CS EIP Vector=6 Error=0 DS ES FS GS GPR (eax, ecx, edx, ebx, cr2,... ) entry_6: push $6 jmp entry_exc entry_exc: push $0 entry_exc_err: push %ds push %es push %fs push %gs pusha mov %esp, %ebx mov $KSTCK_BEGIN, %esp mov %cr2, %eax mov %eax, 0xc(%ebx) mov %ebx, %eax call exc_handler jmp ret_from_interrupt 25 / 45

26 Kernel Entry SS ESP EFLAGS CS EIP Vector=6 Error=0 DS ES FS GS GPR (eax, ecx, edx, ebx, cr2,... ) entry_6: push $6 jmp entry_exc entry_exc: push $0 entry_exc_err: push %ds push %es push %fs push %gs pusha mov %esp, %ebx mov $KSTCK_BEGIN, %esp mov %cr2, %eax mov %eax, 0xc(%ebx) mov %ebx, %eax call exc handler jmp ret_from_interrupt 26 / 45

27 Exception Handler REGPARM(1) void exc_handler (Exc_regs *r) { switch (r->vec) { case Cpu::EXC_TS: handle_exc_ts (r); break; case Cpu::EXC_PF: handle_exc_pf (r); break;... } } void handle_exc_pf (Exc_regs *r) { mword addr = r->cr2; if(pd::current->space_mem::loc[cpu::id].sync_from ( Pd::current->Space_mem::hpt, addr)) return;... } 27 / 45

28 Kernel Exit to Kernel Mode SS ESP EFLAGS CS EIP Vector=6 Error=0 DS ES FS GS GPR (eax, ecx, edx, ebx, cr2,... )... mov %esp, %ebx mov $KSTCK_BEGIN, %esp mov %cr2, %eax mov %eax, 0xc(%ebx) mov %ebx, %eax call exc_handler jmp ret from interrupt ret_from_interrupt: testb $3, 0x3c(%ebx) jnz ret_user_iret popa add $24, %esp iret 28 / 45

29 Kernel Exit to Kernel Mode SS ESP EFLAGS CS EIP Vector=6 Error=0 DS ES FS GS GPR (eax, ecx, edx, ebx, cr2,... )... mov %esp, %ebx mov $KSTCK_BEGIN, %esp mov %cr2, %eax mov %eax, 0xc(%ebx) mov %ebx, %eax call exc_handler jmp ret_from_interrupt ret_from_interrupt: testb $3, 0x3c(%ebx) jnz ret user iret popa add $24, %esp iret 29 / 45

30 Kernel Exit to Kernel Mode SS ESP EFLAGS CS EIP Vector=6 Error=0 DS ES FS GS GPR (eax, ecx, edx, ebx, cr2,... )... mov %esp, %ebx mov $KSTCK_BEGIN, %esp mov %cr2, %eax mov %eax, 0xc(%ebx) mov %ebx, %eax call exc_handler jmp ret_from_interrupt ret_from_interrupt: testb $3, 0x3c(%ebx) jnz ret_user_iret popa add $24, %esp iret 30 / 45

31 Kernel Exit to Kernel Mode SS ESP EFLAGS CS EIP Vector=6 Error=0 DS ES FS GS... mov %esp, %ebx mov $KSTCK_BEGIN, %esp mov %cr2, %eax mov %eax, 0xc(%ebx) mov %ebx, %eax call exc_handler jmp ret_from_interrupt ret_from_interrupt: testb $3, 0x3c(%ebx) jnz ret_user_iret popa add $24, %esp iret 31 / 45

32 Kernel Exit to Kernel Mode SS ESP EFLAGS CS EIP... mov %esp, %ebx mov $KSTCK_BEGIN, %esp mov %cr2, %eax mov %eax, 0xc(%ebx) mov %ebx, %eax call exc_handler jmp ret_from_interrupt ret_from_interrupt: testb $3, 0x3c(%ebx) jnz ret_user_iret popa add $24, %esp iret 32 / 45

33 Kernel Exit to Kernel Mode... mov %esp, %ebx mov $KSTCK_BEGIN, %esp mov %cr2, %eax mov %eax, 0xc(%ebx) mov %ebx, %eax call exc_handler jmp ret_from_interrupt ret_from_interrupt: testb $3, 0x3c(%ebx) jnz ret_user_iret popa add $24, %esp iret 33 / 45

34 Kernel Exit to User Mode SS ESP EFLAGS CS EIP Vector=6 Error=0 DS ES FS GS GPR (eax, ecx, edx, ebx, cr2,... )... mov %esp, %ebx mov $KSTCK_BEGIN, %esp mov %cr2, %eax mov %eax, 0xc(%ebx) mov %ebx, %eax call exc_handler jmp ret_from_interrupt ret_from_interrupt: testb $3, 0x3c(%ebx) jnz ret user iret popa add $24, %esp iret 34 / 45

35 Kernel Exit to User Mode SS ESP EFLAGS CS EIP Vector=6 Error=0 DS ES FS GS GPR (eax, ecx, edx, ebx, cr2,... ) void ret_user_iret() { handle hazards(); } asm volatile ( "lea %0, %%esp;" "popa;" "pop %%gs;" "pop %%fs;" "pop %%es;" "pop %%ds;" "add $8, %%esp;" "iret;" : : "m" (current->regs) : "memory" ); UNREACHED; 35 / 45

36 Kernel Exit to User Mode SS ESP EFLAGS CS EIP Vector=6 Error=0 DS ES FS GS GPR (eax, ecx, edx, ebx, cr2,... ) void ret_user_iret() { handle_hazards(); } asm volatile ( "lea %0, %%esp;" "popa;" "pop %%gs;" "pop %%fs;" "pop %%es;" "pop %%ds;" "add $8, %%esp;" "iret;" : : "m" (current->regs) : "memory" ); UNREACHED; 36 / 45

37 Kernel Exit to User Mode SS ESP EFLAGS CS EIP Vector=6 Error=0 DS ES FS GS GPR (eax, ecx, edx, ebx, cr2,... ) void ret_user_iret() { handle_hazards(); } asm volatile ( "lea %0, %%esp;" "popa;" "pop %%gs;" "pop %%fs;" "pop %%es;" "pop %%ds;" "add $8, %%esp;" "iret;" : : "m" (current->regs) : "memory" ); UNREACHED; 37 / 45

38 Kernel Exit to User Mode SS ESP EFLAGS CS EIP Vector=6 Error=0 DS ES FS GS void ret_user_iret() { handle_hazards(); } asm volatile ( "lea %0, %%esp;" "popa;" "pop %%gs;" "pop %%fs;" "pop %%es;" "pop %%ds;" "add $8, %%esp;" "iret;" : : "m" (current->regs) : "memory" ); UNREACHED; 38 / 45

39 Kernel Exit to User Mode SS ESP EFLAGS CS EIP Vector=6 Error=0 void ret_user_iret() { handle_hazards(); } asm volatile ( "lea %0, %%esp;" "popa;" "pop %%gs;" "pop %%fs;" "pop %%es;" "pop %%ds;" "add $8, %%esp;" "iret;" : : "m" (current->regs) : "memory" ); UNREACHED; 39 / 45

40 Kernel Exit to User Mode SS ESP EFLAGS CS EIP void ret_user_iret() { handle_hazards(); } asm volatile ( "lea %0, %%esp;" "popa;" "pop %%gs;" "pop %%fs;" "pop %%es;" "pop %%ds;" "add $8, %%esp;" "iret;" : : "m" (current->regs) : "memory" ); UNREACHED; 40 / 45

41 Kernel Exit to User Mode void ret_user_iret() { handle_hazards(); } asm volatile ( "lea %0, %%esp;" "popa;" "pop %%gs;" "pop %%fs;" "pop %%es;" "pop %%ds;" "add $8, %%esp;" "iret;" : : "m" (current->regs) : "memory" ); UNREACHED; 41 / 45

42 Kernel Exit: IRET Load code segment selector, EIP and flags from stack Evaluate RPL of CS from stack RPL > CPL: return to other privilege level otherwise: return to same privilege level If privilege level changes Load stack segment selector and ESP from stack Adjust CPL 42 / 45

43 Fast Kernel Entry: SYSENTER Fast ring transition from any ring to ring 0 Kernel code entry point specified via SYSENTER CS MSR (code segment) SYSENTER EIP MSR (entry function) SYSENTER ESP MSR (kernel stack pointer) CPU... Disables interrupts Loads kernel CS (from SYSENTER CS MSR) Loads kernel SS (from SYSENTER CS MSR + 8) Loads kernel ESP (from SYSENTER ESP MSR) Loads kernel EIP (from SYSENTER EIP MSR) Does NOT save user return EIP or other user state 43 / 45

44 Fast Kernel Exit: SYSEXIT Fast ring transition from any ring to ring 3 CPU... Loads user CS (from SYSENTER CS MSR + 16) Loads user SS (from SYSENTER CS MSR + 24) Loads user ESP (from ECX) Loads user EIP (from EDX) Enables interrupts 44 / 45

45 Next Weeks May, 11th: Exercise 1 (Kernel entry/exit) in room E067 May, 18th: Exercise 2 (Multiboot, ELF) in room E067 May, 25th: Interprocess communication June, 1st: Exercise 3 (Thread switching) in room E067 June, 8th: Capabilities / 45

Microkernel Construction

Microkernel Construction Kernel Entry / Exit SS2013 Control Transfer Microkernel User Stack A Address Space Kernel Stack A User Stack User Stack B Address Space Kernel Stack B User Stack 1. Kernel Entry (A) 2. Thread Switch (A

More information

Tutorial 10 Protection Cont.

Tutorial 10 Protection Cont. Tutorial 0 Protection Cont. 2 Privilege Levels Lower number => higher privilege Code can access data of equal/lower privilege levels only Code can call more privileged data via call gates Each level has

More information

Part I. X86 architecture overview. Secure Operating System Design and Implementation x86 architecture. x86 processor modes. X86 architecture overview

Part I. X86 architecture overview. Secure Operating System Design and Implementation x86 architecture. x86 processor modes. X86 architecture overview X86 architecture overview Overview Secure Operating System Design and Implementation x86 architecture Jon A. Solworth Part I X86 architecture overview Dept. of Computer Science University of Illinois at

More information

IA32 Intel 32-bit Architecture

IA32 Intel 32-bit Architecture 1 2 IA32 Intel 32-bit Architecture Intel 32-bit Architecture (IA32) 32-bit machine CISC: 32-bit internal and external data bus 32-bit external address bus 8086 general registers extended to 32 bit width

More information

PROTECTION CHAPTER 4 PROTECTION

PROTECTION CHAPTER 4 PROTECTION Protection 4 CHAPTER 4 PROTECTION In protected mode, the Intel Architecture provides a protection mechanism that operates at both the segment level and the page level. This protection mechanism provides

More information

Operating Systems Engineering Recitation #3 (part 2): Interrupt and Exception Handling on the x86. (heavily) based on MIT 6.

Operating Systems Engineering Recitation #3 (part 2): Interrupt and Exception Handling on the x86. (heavily) based on MIT 6. 236366 Operating Systems Engineering Recitation #3 (part 2): Interrupt and Exception Handling on the x86 (heavily) based on MIT 6.828 (2005, lec8) x86 Interrupt Nomenclature Hardware Interrupt (external)

More information

Mechanisms for entering the system

Mechanisms for entering the system Mechanisms for entering the system Yolanda Becerra Fontal Juan José Costa Prats Facultat d'informàtica de Barcelona (FIB) Universitat Politècnica de Catalunya (UPC) BarcelonaTech 2017-2018 QP Content Introduction

More information

x86 segmentation, page tables, and interrupts 3/17/08 Frans Kaashoek MIT

x86 segmentation, page tables, and interrupts 3/17/08 Frans Kaashoek MIT x86 segmentation, page tables, and interrupts 3/17/08 Frans Kaashoek MIT kaashoek@mit.edu Outline Enforcing modularity with virtualization Virtualize processor and memory x86 mechanism for virtualization

More information

+ Overview. Projects: Developing an OS Kernel for x86. ! Handling Intel Processor Exceptions: the Interrupt Descriptor Table (IDT)

+ Overview. Projects: Developing an OS Kernel for x86. ! Handling Intel Processor Exceptions: the Interrupt Descriptor Table (IDT) + Projects: Developing an OS Kernel for x86 Low-Level x86 Programming: Exceptions, Interrupts, and Timers + Overview! Handling Intel Processor Exceptions: the Interrupt Descriptor Table (IDT)! Handling

More information

UMBC. contain new IP while 4th and 5th bytes contain CS. CALL BX and CALL [BX] versions also exist. contain displacement added to IP.

UMBC. contain new IP while 4th and 5th bytes contain CS. CALL BX and CALL [BX] versions also exist. contain displacement added to IP. Procedures: CALL: Pushes the address of the instruction following the CALL instruction onto the stack. RET: Pops the address. SUM PROC NEAR USES BX CX DX ADD AX, BX ADD AX, CX MOV AX, DX RET SUM ENDP NEAR

More information

W4118: interrupt and system call. Junfeng Yang

W4118: interrupt and system call. Junfeng Yang W4118: interrupt and system call Junfeng Yang Outline Motivation for protection Interrupt System call 2 Need for protection Kernel privileged, cannot trust user processes User processes may be malicious

More information

Scott M. Lewandowski CS295-2: Advanced Topics in Debugging September 21, 1998

Scott M. Lewandowski CS295-2: Advanced Topics in Debugging September 21, 1998 Scott M. Lewandowski CS295-2: Advanced Topics in Debugging September 21, 1998 Assembler Syntax Everything looks like this: label: instruction dest,src instruction label Comments: comment $ This is a comment

More information

Introduction to The x86 Microprocessor

Introduction to The x86 Microprocessor Introduction to The x86 Microprocessor Prof. V. Kamakoti Digital Circuits And VLSI Laboratory Indian Institute of Technology, Madras Chennai - 600 036. http://vlsi.cs.iitm.ernet.in Protected Mode Memory

More information

MICROPROCESSOR MICROPROCESSOR ARCHITECTURE. Prof. P. C. Patil UOP S.E.COMP (SEM-II)

MICROPROCESSOR MICROPROCESSOR ARCHITECTURE. Prof. P. C. Patil UOP S.E.COMP (SEM-II) MICROPROCESSOR UOP S.E.COMP (SEM-II) 80386 MICROPROCESSOR ARCHITECTURE Prof. P. C. Patil Department of Computer Engg Sandip Institute of Engineering & Management Nashik pc.patil@siem.org.in 1 Introduction

More information

BASIC INTERRUPT PROCESSING

BASIC INTERRUPT PROCESSING Interrupts BASIC INTERRUPT PROCESSING This section discusses the function of an interrupt in a microprocessor-based system. Structure and features of interrupts available to Intel microprocessors. The

More information

ICS143A: Principles of Operating Systems. Midterm recap, sample questions. Anton Burtsev February, 2017

ICS143A: Principles of Operating Systems. Midterm recap, sample questions. Anton Burtsev February, 2017 ICS143A: Principles of Operating Systems Midterm recap, sample questions Anton Burtsev February, 2017 Describe the x86 address translation pipeline (draw figure), explain stages. Address translation What

More information

iapx Systems Electronic Computers M

iapx Systems Electronic Computers M iapx Systems Electronic Computers M 1 iapx History We analyze 32 bit systems: generalization to 64 bits is straigtforward Segment Registers (16 bits) Code Segment Stack Segment Data Segment Extra Ssegment

More information

MICROPROCESSOR MICROPROCESSOR ARCHITECTURE. Prof. P. C. Patil UOP S.E.COMP (SEM-II)

MICROPROCESSOR MICROPROCESSOR ARCHITECTURE. Prof. P. C. Patil UOP S.E.COMP (SEM-II) MICROPROCESSOR UOP S.E.COMP (SEM-II) 80386 MICROPROCESSOR ARCHITECTURE Prof. P. C. Patil Department of Computer Engg Sandip Institute of Engineering & Management Nashik pc.patil@siem.org.in 1 Introduction

More information

Low Level Programming Lecture 2. International Faculty of Engineerig, Technical University of Łódź

Low Level Programming Lecture 2. International Faculty of Engineerig, Technical University of Łódź Low Level Programming Lecture 2 Intel processors' architecture reminder Fig. 1. IA32 Registers IA general purpose registers EAX- accumulator, usually used to store results of integer arithmetical or binary

More information

Homework / Exam. Return and Review Exam #1 Reading. Machine Projects. Labs. S&S Extracts , PIC Data Sheet. Start on mp3 (Due Class 19)

Homework / Exam. Return and Review Exam #1 Reading. Machine Projects. Labs. S&S Extracts , PIC Data Sheet. Start on mp3 (Due Class 19) Homework / Exam Return and Review Exam #1 Reading S&S Extracts 385-393, PIC Data Sheet Machine Projects Start on mp3 (Due Class 19) Labs Continue in labs with your assigned section 1 Interrupts An interrupt

More information

iapx86 Protection Electronic Computers M

iapx86 Protection Electronic Computers M iapx86 Protection Electronic Computers M 1 Protection Multitasking (multiple processes) > the system must prevent an uncontrolled access of a process to the memory space of another process....and that

More information

Information Security II Prof. Kamakoti Department of Computer Science and Engineering Indian Institute of Technology, Madras

Information Security II Prof. Kamakoti Department of Computer Science and Engineering Indian Institute of Technology, Madras Information Security II Prof. Kamakoti Department of Computer Science and Engineering Indian Institute of Technology, Madras Lecture 30 Task Switch recap - Week 6 (Refer Slide Time: 00:09) So welcome back

More information

AMD-K5. Software Development Guide PROCESSOR

AMD-K5. Software Development Guide PROCESSOR AMD-K5 TM PROCESSOR Software Development Guide Publication # 20007 Rev: D Amendment/0 Issue Date: September 1996 This document contains information on a product under development at Advanced Micro Devices

More information

6.828: Using Virtual Memory. Adam Belay

6.828: Using Virtual Memory. Adam Belay 6.828: Using Virtual Memory Adam Belay abelay@mit.edu 1 Outline Cool things you can do with virtual memory: Lazy page allocation (homework) Better performance/efficiency E.g. One zero-filled page E.g.

More information

MOV Move INSTRUCTION SET REFERENCE, A-M. Description. Opcode Instruction 64-Bit Mode. Compat/ Leg Mode

MOV Move INSTRUCTION SET REFERENCE, A-M. Description. Opcode Instruction 64-Bit Mode. Compat/ Leg Mode Opcode Instruction 64-Bit Mode Compat/ Leg Mode 88 /r MOV r/m8,r8 Valid Valid Move r8 to r/m8. REX + 88 /r MOV r/m8 ***, r8 *** Valid N.E. Move r8 to r/m8. 89 /r MOV r/m16,r16 Valid Valid Move r16 to r/m16.

More information

2.5 Address Space. The IBM 6x86 CPU can directly address 64 KBytes of I/O space and 4 GBytes of physical memory (Figure 2-24).

2.5 Address Space. The IBM 6x86 CPU can directly address 64 KBytes of I/O space and 4 GBytes of physical memory (Figure 2-24). Address Space 2.5 Address Space The IBM 6x86 CPU can directly address 64 KBytes of I/O space and 4 GBytes of physical memory (Figure 2-24). Memory Address Space. Access can be made to memory addresses

More information

MICROPROCESSOR ALL IN ONE. Prof. P. C. Patil UOP S.E.COMP (SEM-II)

MICROPROCESSOR ALL IN ONE. Prof. P. C. Patil UOP S.E.COMP (SEM-II) MICROPROCESSOR UOP S.E.COMP (SEM-II) 80386 ALL IN ONE Prof. P. C. Patil Department of Computer Engg Sandip Institute of Engineering & Management Nashik pc.patil@siem.org.in 1 Architecture of 80386 2 ARCHITECTURE

More information

Protection and System Calls. Otto J. Anshus

Protection and System Calls. Otto J. Anshus Protection and System Calls Otto J. Anshus Protection Issues CPU protection Prevent a user from using the CPU for too long Throughput of jobs, and response time to events (incl. user interactive response

More information

µ-kernel Construction

µ-kernel Construction µ-kernel Construction Fundamental Abstractions Thread Address Space What is a thread? How to implement? What conclusions can we draw from our analysis with respect to µk construction? A thread of control

More information

W4118: PC Hardware and x86. Junfeng Yang

W4118: PC Hardware and x86. Junfeng Yang W4118: PC Hardware and x86 Junfeng Yang A PC How to make it do something useful? 2 Outline PC organization x86 instruction set gcc calling conventions PC emulation 3 PC board 4 PC organization One or more

More information

Basic Execution Environment

Basic Execution Environment Basic Execution Environment 3 CHAPTER 3 BASIC EXECUTION ENVIRONMENT This chapter describes the basic execution environment of an Intel Architecture processor as seen by assembly-language programmers.

More information

Embedded Systems Programming

Embedded Systems Programming Embedded Systems Programming x86 Memory and Interrupt (Module 8) Yann-Hang Lee Arizona State University yhlee@asu.edu (480) 727-7507 Summer 2014 X86 ISA Data Representations Little-endian byte ordering

More information

W4118: virtual machines

W4118: virtual machines W4118: virtual machines Instructor: Junfeng Yang References: Modern Operating Systems (3 rd edition), Operating Systems Concepts (8 th edition), previous W4118, and OS at MIT, Stanford, and UWisc Virtual

More information

What You Need to Know for Project Three. Dave Eckhardt Steve Muckle

What You Need to Know for Project Three. Dave Eckhardt Steve Muckle What You Need to Know for Project Three Dave Eckhardt Steve Muckle Overview Introduction to the Kernel Project Mundane Details in x86 registers, paging, the life of a memory access, context switching,

More information

An Interrupt is either a Hardware generated CALL (externally derived from a hardware signal)

An Interrupt is either a Hardware generated CALL (externally derived from a hardware signal) An Interrupt is either a Hardware generated CALL (externally derived from a hardware signal) OR A Software-generated CALL (internally derived from the execution of an instruction or by some other internal

More information

CSCI 350 Ch. 2 The Kernel Abstraction & Protection. Mark Redekopp

CSCI 350 Ch. 2 The Kernel Abstraction & Protection. Mark Redekopp 1 CSCI 350 Ch. 2 The Kernel Abstraction & Protection Mark Redekopp PROCESSES & PROTECTION 2 3 Processes Process (def 1.) Address Space + Threads 1 or more threads (def 2.) : Running instance of a program

More information

Buffer Overflow Attack

Buffer Overflow Attack Buffer Overflow Attack What every applicant for the hacker should know about the foundation of buffer overflow attacks By (Dalgona@wowhacker.org) Email: zinwon@gmail.com 2005 9 5 Abstract Buffer overflow.

More information

IA32/Linux Virtual Memory Architecture

IA32/Linux Virtual Memory Architecture IA32/Linux Virtual Memory Architecture Basic Execution Environment Application Programming Registers General-purpose registers 31 0 EAX AH AL EBX BH BL ECX CH CL EDX DH DL EBP ESI EDI BP SI DI Segment

More information

Threads, System Calls, and Thread Switching

Threads, System Calls, and Thread Switching µ-kernel Construction (2) Threads, System Calls, and Thread Switching (updated on 2009-05-08) Review from Last Lecture The 100-µs Disaster 25 MHz 386 50 MHz 486 90 MHz Pentium 133 MHz Alpha 3 C Costs (486,

More information

CanSecWest Nicolás A. Economou Andrés Lopez Luksenberg

CanSecWest Nicolás A. Economou Andrés Lopez Luksenberg CanSecWest 2012 Nicolás A. Economou Andrés Lopez Luksenberg INTRO There have been as many new MBR threats found in the first seven months of 2011 as there were in previous three years.... Symantec Intelligence

More information

The Microprocessor and its Architecture

The Microprocessor and its Architecture The Microprocessor and its Architecture Contents Internal architecture of the Microprocessor: The programmer s model, i.e. The registers model The processor model (organization) Real mode memory addressing

More information

3. Process Management in xv6

3. Process Management in xv6 Lecture Notes for CS347: Operating Systems Mythili Vutukuru, Department of Computer Science and Engineering, IIT Bombay 3. Process Management in xv6 We begin understanding xv6 process management by looking

More information

Introduction to IA-32. Jo, Heeseung

Introduction to IA-32. Jo, Heeseung Introduction to IA-32 Jo, Heeseung IA-32 Processors Evolutionary design Starting in 1978 with 8086 Added more features as time goes on Still support old features, although obsolete Totally dominate computer

More information

Darshan Institute of Engineering & Technology

Darshan Institute of Engineering & Technology 1. Explain 80286 architecture. OR List the four major processing units in an 80286 microprocessor and briefly describe the function of each. Ans - The 80286 was designed for multi-user systems with multitasking

More information

INTRODUCTION TO IA-32. Jo, Heeseung

INTRODUCTION TO IA-32. Jo, Heeseung INTRODUCTION TO IA-32 Jo, Heeseung IA-32 PROCESSORS Evolutionary design Starting in 1978 with 8086 Added more features as time goes on Still support old features, although obsolete Totally dominate computer

More information

Introduction to the Process David E. Culler CS162 Operating Systems and Systems Programming Lecture 2 Sept 3, 2014

Introduction to the Process David E. Culler CS162 Operating Systems and Systems Programming Lecture 2 Sept 3, 2014 Introduction to the Process David E. Culler CS162 Operating Systems and Systems Programming Lecture 2 Sept 3, 2014 Reading: A&D CH2.1-7 HW: 0 out, due 9/8 Recall: What is an operating system? Special layer

More information

CS3210: Booting and x86

CS3210: Booting and x86 CS3210: Booting and x86 Lecture 2 Instructor: Dr. Tim Andersen 1 / 34 Today: Bootstrapping CPU -> needs a first instruction Memory -> needs initial code/data I/O -> needs to know how to communicate 2 /

More information

Program Exploitation Intro

Program Exploitation Intro Program Exploitation Intro x86 Assembly 04//2018 Security 1 Univeristà Ca Foscari, Venezia What is Program Exploitation "Making a program do something unexpected and not planned" The right bugs can be

More information

x86 architecture et similia

x86 architecture et similia x86 architecture et similia 1 FREELY INSPIRED FROM CLASS 6.828, MIT A full PC has: PC architecture 2 an x86 CPU with registers, execution unit, and memory management CPU chip pins include address and data

More information

µ-kernel Construction

µ-kernel Construction µ-kernel Construction Fundamental Abstractions Thread Address Space What is a thread? How to implement? What conclusions can we draw from our analysis with respect to µk construction? Processor? IP SP

More information

6/17/2011. Introduction. Chapter Objectives Upon completion of this chapter, you will be able to:

6/17/2011. Introduction. Chapter Objectives Upon completion of this chapter, you will be able to: Chapter 2: The Microprocessor and its Architecture Chapter 2: The Microprocessor and its Architecture Chapter 2: The Microprocessor and its Architecture Introduction This chapter presents the microprocessor

More information

143A: Principles of Operating Systems. Lecture 6: Address translation. Anton Burtsev January, 2017

143A: Principles of Operating Systems. Lecture 6: Address translation. Anton Burtsev January, 2017 143A: Principles of Operating Systems Lecture 6: Address translation Anton Burtsev January, 2017 Address translation Segmentation Descriptor table Descriptor table Base address 0 4 GB Limit

More information

µ-kernel Construction (12)

µ-kernel Construction (12) µ-kernel Construction (12) Review 1 Threading Thread state must be saved/restored on thread switch We need a Thread Control Block (TCB) per thread TCBs must be kernel objects TCBs implement threads We

More information

CHAPTER 6 INTERRUPT AND EXCEPTION HANDLING

CHAPTER 6 INTERRUPT AND EXCEPTION HANDLING CHATER 6 INTERRUT AND EXCETION HANDLING This chapter describes the interrupt and exception-handling mechanism when operating in protected mode on an I ntel 64 or I A-32 processor. Most of the information

More information

Chapter 2: The Microprocessor and its Architecture

Chapter 2: The Microprocessor and its Architecture Chapter 2: The Microprocessor and its Architecture Chapter 2: The Microprocessor and its Architecture Chapter 2: The Microprocessor and its Architecture Introduction This chapter presents the microprocessor

More information

Pre-virtualization internals

Pre-virtualization internals Pre-virtualization internals Joshua LeVasseur 3 March 2006 L4Ka.org Universität Karlsruhe (TH) Compile time overview Compiler C code Assembler code OS source code Hand-written assembler Afterburner Assembler

More information

Chap.6 Limited Direct Execution. Dongkun Shin, SKKU

Chap.6 Limited Direct Execution. Dongkun Shin, SKKU Chap.6 Limited Direct Execution 1 Problems of Direct Execution The OS must virtualize the CPU in an efficient manner while retaining control over the system. Problems how can the OS make sure the program

More information

For your convenience Apress has placed some of the front matter material after the index. Please use the Bookmarks and Contents at a Glance links to

For your convenience Apress has placed some of the front matter material after the index. Please use the Bookmarks and Contents at a Glance links to For your convenience Apress has placed some of the front matter material after the index. Please use the Bookmarks and Contents at a Glance links to access them. Contents at a Glance About the Author...xi

More information

143A: Principles of Operating Systems. Lecture 5: Address translation. Anton Burtsev October, 2018

143A: Principles of Operating Systems. Lecture 5: Address translation. Anton Burtsev October, 2018 143A: Principles of Operating Systems Lecture 5: Address translation Anton Burtsev October, 2018 Two programs one memory Or more like renting a set of rooms in an office building Or more like renting a

More information

Practical Malware Analysis

Practical Malware Analysis Practical Malware Analysis Ch 4: A Crash Course in x86 Disassembly Revised 1-16-7 Basic Techniques Basic static analysis Looks at malware from the outside Basic dynamic analysis Only shows you how the

More information

Operating Systems and Protection CS 217

Operating Systems and Protection CS 217 Operating Systems and Protection CS 7 Goals of Today s Lecture How multiple programs can run at once o es o Context switching o control block o Virtual Boundary between parts of the system o User programs

More information

M80C286 HIGH PERFORMANCE CHMOS MICROPROCESSOR WITH MEMORY MANAGEMENT AND PROTECTION

M80C286 HIGH PERFORMANCE CHMOS MICROPROCESSOR WITH MEMORY MANAGEMENT AND PROTECTION HIGH PERFORMANCE CHMOS MICROPROCESSOR WITH MEMORY MANAGEMENT AND PROTECTION Military Y High Speed CHMOS III Technology Pin for Pin Clock for Clock and Functionally Compatible with the HMOS M80286 Y 10

More information

CS3210: Booting and x86. Taesoo Kim

CS3210: Booting and x86. Taesoo Kim 1 CS3210: Booting and x86 Taesoo Kim 2 What is an operating system? e.g. OSX, Windows, Linux, FreeBSD, etc. What does an OS do for you? Abstract the hardware for convenience and portability Multiplex the

More information

CS 3803 Lab 6 Interrupts Assigned 2/25/10 Point Value: 30

CS 3803 Lab 6 Interrupts Assigned 2/25/10 Point Value: 30 CS 3803 Lab 6 Interrupts Assigned 2/25/10 Point Value: 30 Purpose Interrupts are crucial to an operating system. They are used to get status and data from the timer, keyboard, and disk drives to mention

More information

Interrupts and System Calls

Interrupts and System Calls Housekeeping Interrupts and System Calls Don Porter CSE 506 Welcome TA Amit Arya Office Hours posted Next Thursday s class has a reading assignment Lab 1 due Friday All students should have VMs at this

More information

238P: Operating Systems. Lecture 5: Address translation. Anton Burtsev January, 2018

238P: Operating Systems. Lecture 5: Address translation. Anton Burtsev January, 2018 238P: Operating Systems Lecture 5: Address translation Anton Burtsev January, 2018 Two programs one memory Very much like car sharing What are we aiming for? Illusion of a private address space Identical

More information

Complex Instruction Set Computer (CISC)

Complex Instruction Set Computer (CISC) Introduction ti to IA-32 IA-32 Processors Evolutionary design Starting in 1978 with 886 Added more features as time goes on Still support old features, although obsolete Totally dominate computer market

More information

Operating systems offer processes running in User Mode a set of interfaces to interact with hardware devices such as

Operating systems offer processes running in User Mode a set of interfaces to interact with hardware devices such as System call Overview 2 Operating systems offer processes running in User Mode a set of interfaces to interact with hardware devices such as the CPU disks printers Unix systems implement most interfaces

More information

Windows Kernel Internals Traps, Interrupts, Exceptions

Windows Kernel Internals Traps, Interrupts, Exceptions Windows Kernel Internals Traps, Interrupts, Exceptions David B. Probert, Ph.D. Windows Kernel Development Microsoft Corporation Microsoft Corporation 1 What makes an OS interesting! Fundamental abstractions

More information

Dr. Ramesh K. Karne Department of Computer and Information Sciences, Towson University, Towson, MD /12/2014 Slide 1

Dr. Ramesh K. Karne Department of Computer and Information Sciences, Towson University, Towson, MD /12/2014 Slide 1 Dr. Ramesh K. Karne Department of Computer and Information Sciences, Towson University, Towson, MD 21252 rkarne@towson.edu 11/12/2014 Slide 1 Intel x86 Aseembly Language Assembly Language Assembly Language

More information

CS 550 Operating Systems Spring Interrupt

CS 550 Operating Systems Spring Interrupt CS 550 Operating Systems Spring 2019 Interrupt 1 Revisit -- Process MAX Stack Function Call Arguments, Return Address, Return Values Kernel data segment Kernel text segment Stack fork() exec() Heap Data

More information

CHAPTER 3 BASIC EXECUTION ENVIRONMENT

CHAPTER 3 BASIC EXECUTION ENVIRONMENT CHAPTER 3 BASIC EXECUTION ENVIRONMENT This chapter describes the basic execution environment of an Intel 64 or I A-32 processor as seen by assemblylanguage programmers. It describes how the processor executes

More information

Intel386 TM DX MICROPROCESSOR SPECIFICATION UPDATE

Intel386 TM DX MICROPROCESSOR SPECIFICATION UPDATE Intel386 TM DX MICROPROCESSOR SPECIFICATION UPDATE Release Date: July, 1996 Order Number 272874-001 The Intel386 TM DX Microprocessor may contain design defects or errors known as errata. Characterized

More information

Assembler Programming. Lecture 2

Assembler Programming. Lecture 2 Assembler Programming Lecture 2 Lecture 2 8086 family architecture. From 8086 to Pentium4. Registers, flags, memory organization. Logical, physical, effective address. Addressing modes. Processor Processor

More information

Intel VMX technology

Intel VMX technology Intel VMX technology G. Lettieri 28 Oct. 2015 1 The Virtual Machine Monitor In the context of hardware-assisted virtualization, it is very common to introduce the concept of a Virtual Machine Monitor (VMM).

More information

Intel386 DX PROCESSOR SPECIFICATION UPDATE

Intel386 DX PROCESSOR SPECIFICATION UPDATE Intel386 DX PROCESSOR SPECIFICATION UPDATE Release Date: August, 2004 Order Number: 272874-003 The Intel386 DX processor may contain design defects or errors known as errata. Characterized errata that

More information

We can study computer architectures by starting with the basic building blocks. Adders, decoders, multiplexors, flip-flops, registers,...

We can study computer architectures by starting with the basic building blocks. Adders, decoders, multiplexors, flip-flops, registers,... COMPUTER ARCHITECTURE II: MICROPROCESSOR PROGRAMMING We can study computer architectures by starting with the basic building blocks Transistors and logic gates To build more complex circuits Adders, decoders,

More information

Interrupts and System Calls. Don Porter CSE 506

Interrupts and System Calls. Don Porter CSE 506 Interrupts and System Calls Don Porter CSE 506 Housekeeping ò Welcome TA Amit Arya Office Hours posted ò Next Thursday s class has a reading assignment ò Lab 1 due Friday ò All students should have VMs

More information

The K Project. Interrupt and Exception Handling. LSE Team. May 14, 2018 EPITA. The K Project. LSE Team. Introduction. Interrupt Descriptor Table

The K Project. Interrupt and Exception Handling. LSE Team. May 14, 2018 EPITA. The K Project. LSE Team. Introduction. Interrupt Descriptor Table and Exception Handling EPITA May 14, 2018 (EPITA) May 14, 2018 1 / 37 and Exception Handling Exception : Synchronous with program execution (e.g. division by zero, accessing an invalid address) : Asynchronous

More information

Preliminary Information. AMD Duron Processor Model 7 Revision Guide

Preliminary Information. AMD Duron Processor Model 7 Revision Guide AMD Duron Processor Model 7 Revision Guide Publication # 24806 Rev: E Issue Date: October 2003 2002, 2003 Advanced Micro Devices, Inc. All rights reserved. The contents of this document are provided in

More information

Unit 08 Advanced Microprocessor

Unit 08 Advanced Microprocessor Unit 08 Advanced Microprocessor 1. Features of 80386 The 80386 microprocessor is an enhanced version of the 80286 microprocessor Memory-management unit is enhanced to provide memory paging. The 80386 also

More information

x86 Assembly Tutorial COS 318: Fall 2017

x86 Assembly Tutorial COS 318: Fall 2017 x86 Assembly Tutorial COS 318: Fall 2017 Project 1 Schedule Design Review: Monday 9/25 Sign up for 10-min slot from 3:00pm to 7:00pm Complete set up and answer posted questions (Official) Precept: Monday

More information

MILITARY Intel386 TM HIGH PERFORMANCE 32-BIT MICROPROCESSOR WITH INTEGRATED MEMORY MANAGEMENT

MILITARY Intel386 TM HIGH PERFORMANCE 32-BIT MICROPROCESSOR WITH INTEGRATED MEMORY MANAGEMENT MILITARY Intel386 TM HIGH PERFORMANCE 32-BIT MICROPROCESSOR WITH INTEGRATED MEMORY MANAGEMENT Y Y Y Y Flexible 32-Bit Microprocessor 8 16 32-Bit Data Types 8 General Purpose 32-Bit Registers Very Large

More information

SYSC3601 Microprocessor Systems. Unit 2: The Intel 8086 Architecture and Programming Model

SYSC3601 Microprocessor Systems. Unit 2: The Intel 8086 Architecture and Programming Model SYSC3601 Microprocessor Systems Unit 2: The Intel 8086 Architecture and Programming Model Topics/Reading SYSC3601 2 Microprocessor Systems 1. Registers and internal architecture (Ch 2) 2. Address generation

More information

8/09/2006. µ-kernel Construction. Fundamental Abstractions. Thread Switch A B. Thread Switch A B. user mode A kernel. user mode A

8/09/2006. µ-kernel Construction. Fundamental Abstractions. Thread Switch A B. Thread Switch A B. user mode A kernel. user mode A Fundamental Abstractions µ- Construction Thread Address Space What is a thread? How to implement? What conclusions can we draw from our analysis with rect to µk construction? A thread of control has internal

More information

Assembly Language Lab # 9

Assembly Language Lab # 9 Faculty of Engineering Computer Engineering Department Islamic University of Gaza 2011 Assembly Language Lab # 9 Stacks and Subroutines Eng. Doaa Abu Jabal Assembly Language Lab # 9 Stacks and Subroutines

More information

complex instruction set compute. reduced instruction set compute FETCH&EXECUTE. Instruction Register -

complex instruction set compute. reduced instruction set compute FETCH&EXECUTE. Instruction Register - 3600 XT 8086 AT 80286 386 486 PENTIUM 586 complex instruction set compute FETCH reduced instruction set compute BYTE 4 FETCH RISC CISC 111 112 113 114 115 CISC 121 122 123 RISC 131 132 133 11 12 13 14

More information

The Instruction Set. Chapter 5

The Instruction Set. Chapter 5 The Instruction Set Architecture Level(ISA) Chapter 5 1 ISA Level The ISA level l is the interface between the compilers and the hardware. (ISA level code is what a compiler outputs) 2 Memory Models An

More information

SYSTEM CALL IMPLEMENTATION. CS124 Operating Systems Fall , Lecture 14

SYSTEM CALL IMPLEMENTATION. CS124 Operating Systems Fall , Lecture 14 SYSTEM CALL IMPLEMENTATION CS124 Operating Systems Fall 2017-2018, Lecture 14 2 User Processes and System Calls Previously stated that user applications interact with the kernel via system calls Typically

More information

CIS Operating Systems CPU Mode. Professor Qiang Zeng Spring 2018

CIS Operating Systems CPU Mode. Professor Qiang Zeng Spring 2018 CIS 3207 - Operating Systems CPU Mode Professor Qiang Zeng Spring 2018 CPU Modes Two common modes Kernel mode The CPU has to be in this mode to execute the kernel code User mode The CPU has to be in this

More information

Chapter 12: INTERRUPTS

Chapter 12: INTERRUPTS Chapter 12: INTERRUPTS 12 1 BASIC INTERRUPT PROCESSING This section discusses the function of an interrupt in a microprocessor-based system. Structure and features of interrupts available to Intel microprocessors.

More information

OS-SOMMELIER: Memory-Only Operating System Fingerprinting in the Cloud

OS-SOMMELIER: Memory-Only Operating System Fingerprinting in the Cloud OS-SOMMELIER: Memory-Only Operating System Fingerprinting in the Cloud Yufei Gu, Yangchun Fu, Aravind Prakash Dr. Zhiqiang Lin, Dr. Heng Yin University of Texas at Dallas Syracuse University October 16

More information

CMSC 313 COMPUTER ORGANIZATION & ASSEMBLY LANGUAGE PROGRAMMING LECTURE 09, SPRING 2013

CMSC 313 COMPUTER ORGANIZATION & ASSEMBLY LANGUAGE PROGRAMMING LECTURE 09, SPRING 2013 CMSC 313 COMPUTER ORGANIZATION & ASSEMBLY LANGUAGE PROGRAMMING LECTURE 09, SPRING 2013 TOPICS TODAY I/O Architectures Interrupts Exceptions FETCH EXECUTE CYCLE 1.7 The von Neumann Model This is a general

More information

Interrupts. Chapter 20 S. Dandamudi. Outline. Exceptions

Interrupts. Chapter 20 S. Dandamudi. Outline. Exceptions Interrupts Chapter 20 S. Dandamudi Outline What are interrupts? Types of interrupts Software interrupts Hardware interrupts Exceptions Interrupt processing Protected mode Real mode Software interrupts

More information

Computer Organization (II) IA-32 Processor Architecture. Pu-Jen Cheng

Computer Organization (II) IA-32 Processor Architecture. Pu-Jen Cheng Computer Organization & Assembly Languages Computer Organization (II) IA-32 Processor Architecture Pu-Jen Cheng Materials Some materials used in this course are adapted from The slides prepared by Kip

More information

Machine-level Representation of Programs. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University

Machine-level Representation of Programs. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University Machine-level Representation of Programs Jin-Soo Kim (jinsookim@skku.edu) Computer Systems Laboratory Sungkyunkwan University http://csl.skku.edu Program? 짬뽕라면 준비시간 :10 분, 조리시간 :10 분 재료라면 1개, 스프 1봉지, 오징어

More information

Assembly Language. Lecture 2 - x86 Processor Architecture. Ahmed Sallam

Assembly Language. Lecture 2 - x86 Processor Architecture. Ahmed Sallam Assembly Language Lecture 2 - x86 Processor Architecture Ahmed Sallam Introduction to the course Outcomes of Lecture 1 Always check the course website Don t forget the deadline rule!! Motivations for studying

More information

Interrupts & System Calls

Interrupts & System Calls Interrupts & System Calls Nima Honarmand Previously on CSE306 Open file hw1.txt App Ok, here s handle App 4 App Libraries Libraries Libraries User System Call Table (350 1200) Supervisor Kernel Hardware

More information

Microprocessors and Microcontrollers/High end processors

Microprocessors and Microcontrollers/High end processors Module 8 learning unit 18 Architecture of 8386 The Internal Architecture of 8386 is divided into 3 sections. Central processing unit Memory management unit Bus interface unit Central processing unit is

More information

Assembly Language. Lecture 2 x86 Processor Architecture

Assembly Language. Lecture 2 x86 Processor Architecture Assembly Language Lecture 2 x86 Processor Architecture Ahmed Sallam Slides based on original lecture slides by Dr. Mahmoud Elgayyar Introduction to the course Outcomes of Lecture 1 Always check the course

More information