SlideShare uma empresa Scribd logo
1 de 9
xv6
► For multiprocessor x86 and RISC-V systems, xv6 is a contemporary
reimplementation of the Sixth Edition Unix Operating System. In 2006, it was
developed for educational purposes
► The fields for the kernel stack pointer, the trap frame, and the context deserve special
attention.
► The EAX, ECX, and EDX of these registers are known as callee-save registers,
whereas the EBX, ESI, EDI, ESP, EBP, and EIP are known as callee-save registers.
Handling Interrupts
Interrupts on each machine are assigned unique numbers (IRQs). An interrupt number
is set up during initialization. Every interrupt point to a universal function's IDT
entries, which we will examine shortly.
Once the kernel has started to run, it is not possible to change ESP; it must always take
place as part of the hardware CPU instruction.
Cont.
► As the kernel handles an interrupt, the trap frame is present on the stack. When the
scheduler switches out the process after handling an interrupt, the process context
that was written during the context switch is placed first, then the trap frame, on the
kernel stack. Furthermore, rather than using the kernel stack of the interrupted
process itself to handle interrupts, Linux has a separate interrupt context and related
stack.
PROCESS CREATION
• When a process calls fork, the general trap handling function calls the specific system call
fork function. K calls the allocproc function to allocate a free proc data structure..
• The allocproc function allocates a brand-new process data structure and kernel stack. On the
kernel stack of a new process, it pushes a context structure and a trap frame. The trap frame
is transferred from the parent to the child by the fork function.
SCHEDULER AND CONTEXT
SWITCHING
• In xv6, the following terms are used to describe process states: UNUSED, EMBRYO, SLEEPING,
RUNNABLE, RUNNING, and ZOMBIE. All of the proc structures are kept in a linked list. All actions
taken by the processes listed are secured by ptable.lock. When the scheduler function performs any
operation, the lock is always kept in place.
• The EIP, ESP, and a few additional general-purpose registers are preserved as a component of the
context. The registers of the currently executing process P1 are saved in their context on its stack, and
the registers of P2 are reloaded from its context, switching the CPU from P1 to P2.
FUNCTION OF SWITCHING
• The switch function is responsible for switching between an old context and a new
context. The switch is the only place where a process does not push the context structure
when it is created for the first time.
• Allocproc writes the context for a new process onto the new kernel stack, which switch
will load into the CPU registers when the process starts up for the first time.
PORTABLE.LOCK
• The portable.lock must be held by all functions that use the sched keyword. Process P1
locks portable.lock when the focus switches from it to process P2, which causes the
scheduler thread to switch back to process P2.
• Process P2 returns from the schedule and releases the lock when it is done. Except during a
context switch, when a lock is acquired by one process and released by the other, a process
that locks also typically does the matching unlock.
THANK YOU

Mais conteúdo relacionado

Semelhante a PPT.pptx

04basic Concepts
04basic Concepts04basic Concepts
04basic Concepts
Zhiwen Guo
 
The sparc architecture (3)
The sparc architecture (3)The sparc architecture (3)
The sparc architecture (3)
vishuupra
 
Xilkernel
XilkernelXilkernel
Xilkernel
Vincent Claes
 
Multithreading computer architecture
 Multithreading computer architecture  Multithreading computer architecture
Multithreading computer architecture
Haris456
 

Semelhante a PPT.pptx (20)

Malware Analysis - x86 Disassembly
Malware Analysis - x86 DisassemblyMalware Analysis - x86 Disassembly
Malware Analysis - x86 Disassembly
 
The sunsparc architecture
The sunsparc architectureThe sunsparc architecture
The sunsparc architecture
 
POLITEKNIK MALAYSIA
POLITEKNIK MALAYSIAPOLITEKNIK MALAYSIA
POLITEKNIK MALAYSIA
 
Computer Organization: Introduction to Microprocessor and Microcontroller
Computer Organization: Introduction to Microprocessor and MicrocontrollerComputer Organization: Introduction to Microprocessor and Microcontroller
Computer Organization: Introduction to Microprocessor and Microcontroller
 
Functional approach to packet processing
Functional approach to packet processingFunctional approach to packet processing
Functional approach to packet processing
 
Ipl process
Ipl processIpl process
Ipl process
 
Ipl process
Ipl processIpl process
Ipl process
 
Microcontroller overview 1
Microcontroller overview 1Microcontroller overview 1
Microcontroller overview 1
 
Performance Characterization of the Pentium Pro Processor
Performance Characterization of the Pentium Pro ProcessorPerformance Characterization of the Pentium Pro Processor
Performance Characterization of the Pentium Pro Processor
 
nasm_final
nasm_finalnasm_final
nasm_final
 
04basic Concepts
04basic Concepts04basic Concepts
04basic Concepts
 
Java memory model
Java memory modelJava memory model
Java memory model
 
Iii eee-ee8691-embedded sys comparison of rtos
Iii eee-ee8691-embedded sys comparison of rtosIii eee-ee8691-embedded sys comparison of rtos
Iii eee-ee8691-embedded sys comparison of rtos
 
The sparc architecture (3)
The sparc architecture (3)The sparc architecture (3)
The sparc architecture (3)
 
Introduction to debugging linux applications
Introduction to debugging linux applicationsIntroduction to debugging linux applications
Introduction to debugging linux applications
 
Xilkernel
XilkernelXilkernel
Xilkernel
 
Nodes and Networks for HPC computing
Nodes and Networks for HPC computingNodes and Networks for HPC computing
Nodes and Networks for HPC computing
 
SOC Peripheral Components & SOC Tools
SOC Peripheral Components & SOC ToolsSOC Peripheral Components & SOC Tools
SOC Peripheral Components & SOC Tools
 
Multithreading computer architecture
 Multithreading computer architecture  Multithreading computer architecture
Multithreading computer architecture
 
Ch3-2
Ch3-2Ch3-2
Ch3-2
 

Último

Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
Epec Engineered Technologies
 
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
AldoGarca30
 
Verification of thevenin's theorem for BEEE Lab (1).pptx
Verification of thevenin's theorem for BEEE Lab (1).pptxVerification of thevenin's theorem for BEEE Lab (1).pptx
Verification of thevenin's theorem for BEEE Lab (1).pptx
chumtiyababu
 

Último (20)

Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
 
Engineering Drawing focus on projection of planes
Engineering Drawing focus on projection of planesEngineering Drawing focus on projection of planes
Engineering Drawing focus on projection of planes
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
 
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
 
Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptx
 
kiln thermal load.pptx kiln tgermal load
kiln thermal load.pptx kiln tgermal loadkiln thermal load.pptx kiln tgermal load
kiln thermal load.pptx kiln tgermal load
 
Employee leave management system project.
Employee leave management system project.Employee leave management system project.
Employee leave management system project.
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdf
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torque
 
Orlando’s Arnold Palmer Hospital Layout Strategy-1.pptx
Orlando’s Arnold Palmer Hospital Layout Strategy-1.pptxOrlando’s Arnold Palmer Hospital Layout Strategy-1.pptx
Orlando’s Arnold Palmer Hospital Layout Strategy-1.pptx
 
Wadi Rum luxhotel lodge Analysis case study.pptx
Wadi Rum luxhotel lodge Analysis case study.pptxWadi Rum luxhotel lodge Analysis case study.pptx
Wadi Rum luxhotel lodge Analysis case study.pptx
 
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
 
AIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech studentsAIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech students
 
Verification of thevenin's theorem for BEEE Lab (1).pptx
Verification of thevenin's theorem for BEEE Lab (1).pptxVerification of thevenin's theorem for BEEE Lab (1).pptx
Verification of thevenin's theorem for BEEE Lab (1).pptx
 
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxS1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
 
Block diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptBlock diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.ppt
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the start
 
Introduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaIntroduction to Serverless with AWS Lambda
Introduction to Serverless with AWS Lambda
 
Computer Networks Basics of Network Devices
Computer Networks  Basics of Network DevicesComputer Networks  Basics of Network Devices
Computer Networks Basics of Network Devices
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leap
 

PPT.pptx

  • 1.
  • 2. xv6 ► For multiprocessor x86 and RISC-V systems, xv6 is a contemporary reimplementation of the Sixth Edition Unix Operating System. In 2006, it was developed for educational purposes ► The fields for the kernel stack pointer, the trap frame, and the context deserve special attention. ► The EAX, ECX, and EDX of these registers are known as callee-save registers, whereas the EBX, ESI, EDI, ESP, EBP, and EIP are known as callee-save registers.
  • 3. Handling Interrupts Interrupts on each machine are assigned unique numbers (IRQs). An interrupt number is set up during initialization. Every interrupt point to a universal function's IDT entries, which we will examine shortly. Once the kernel has started to run, it is not possible to change ESP; it must always take place as part of the hardware CPU instruction.
  • 4. Cont. ► As the kernel handles an interrupt, the trap frame is present on the stack. When the scheduler switches out the process after handling an interrupt, the process context that was written during the context switch is placed first, then the trap frame, on the kernel stack. Furthermore, rather than using the kernel stack of the interrupted process itself to handle interrupts, Linux has a separate interrupt context and related stack.
  • 5. PROCESS CREATION • When a process calls fork, the general trap handling function calls the specific system call fork function. K calls the allocproc function to allocate a free proc data structure.. • The allocproc function allocates a brand-new process data structure and kernel stack. On the kernel stack of a new process, it pushes a context structure and a trap frame. The trap frame is transferred from the parent to the child by the fork function.
  • 6. SCHEDULER AND CONTEXT SWITCHING • In xv6, the following terms are used to describe process states: UNUSED, EMBRYO, SLEEPING, RUNNABLE, RUNNING, and ZOMBIE. All of the proc structures are kept in a linked list. All actions taken by the processes listed are secured by ptable.lock. When the scheduler function performs any operation, the lock is always kept in place. • The EIP, ESP, and a few additional general-purpose registers are preserved as a component of the context. The registers of the currently executing process P1 are saved in their context on its stack, and the registers of P2 are reloaded from its context, switching the CPU from P1 to P2.
  • 7. FUNCTION OF SWITCHING • The switch function is responsible for switching between an old context and a new context. The switch is the only place where a process does not push the context structure when it is created for the first time. • Allocproc writes the context for a new process onto the new kernel stack, which switch will load into the CPU registers when the process starts up for the first time.
  • 8. PORTABLE.LOCK • The portable.lock must be held by all functions that use the sched keyword. Process P1 locks portable.lock when the focus switches from it to process P2, which causes the scheduler thread to switch back to process P2. • Process P2 returns from the schedule and releases the lock when it is done. Except during a context switch, when a lock is acquired by one process and released by the other, a process that locks also typically does the matching unlock.