SlideShare une entreprise Scribd logo
1  sur  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

Contenu connexe

Similaire à PPT.pptx

Malware Analysis - x86 Disassembly
Malware Analysis - x86 DisassemblyMalware Analysis - x86 Disassembly
Malware Analysis - x86 DisassemblyNatraj G
 
The sunsparc architecture
The sunsparc architectureThe sunsparc architecture
The sunsparc architectureTaha Malampatti
 
POLITEKNIK MALAYSIA
POLITEKNIK MALAYSIAPOLITEKNIK MALAYSIA
POLITEKNIK MALAYSIAAiman Hud
 
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 MicrocontrollerAmrutaMehata
 
Functional approach to packet processing
Functional approach to packet processingFunctional approach to packet processing
Functional approach to packet processingNicola Bonelli
 
Microcontroller overview 1
Microcontroller overview 1Microcontroller overview 1
Microcontroller overview 1Sally Salem
 
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 ProcessorDileep Bhandarkar
 
04basic Concepts
04basic Concepts04basic Concepts
04basic ConceptsZhiwen Guo
 
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 rtosBalajiK94
 
The sparc architecture (3)
The sparc architecture (3)The sparc architecture (3)
The sparc architecture (3)vishuupra
 
Introduction to debugging linux applications
Introduction to debugging linux applicationsIntroduction to debugging linux applications
Introduction to debugging linux applicationscommiebstrd
 
Nodes and Networks for HPC computing
Nodes and Networks for HPC computingNodes and Networks for HPC computing
Nodes and Networks for HPC computingrinnocente
 
SOC Peripheral Components & SOC Tools
SOC Peripheral Components & SOC ToolsSOC Peripheral Components & SOC Tools
SOC Peripheral Components & SOC ToolsA B Shinde
 
Multithreading computer architecture
 Multithreading computer architecture  Multithreading computer architecture
Multithreading computer architecture Haris456
 

Similaire à 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
 

Dernier

Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoorTop Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoordharasingh5698
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXssuser89054b
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . pptDineshKumar4165
 
Bhosari ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For ...
Bhosari ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For ...Bhosari ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For ...
Bhosari ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For ...tanu pandey
 
Unit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfUnit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfRagavanV2
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptMsecMca
 
Intro To Electric Vehicles PDF Notes.pdf
Intro To Electric Vehicles PDF Notes.pdfIntro To Electric Vehicles PDF Notes.pdf
Intro To Electric Vehicles PDF Notes.pdfrs7054576148
 
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 torqueBhangaleSonal
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...Call Girls in Nagpur High Profile
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756dollysharma2066
 
Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01KreezheaRecto
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptDineshKumar4165
 
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank  Design by Working Stress - IS Method.pdfIntze Overhead Water Tank  Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank Design by Working Stress - IS Method.pdfSuman Jyoti
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VDineshKumar4165
 
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...SUHANI PANDEY
 
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Bookingroncy bisnoi
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdfankushspencer015
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdfKamal Acharya
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...roncy bisnoi
 

Dernier (20)

Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoorTop Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . ppt
 
Bhosari ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For ...
Bhosari ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For ...Bhosari ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For ...
Bhosari ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For ...
 
Unit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfUnit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdf
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.ppt
 
Intro To Electric Vehicles PDF Notes.pdf
Intro To Electric Vehicles PDF Notes.pdfIntro To Electric Vehicles PDF Notes.pdf
Intro To Electric Vehicles PDF Notes.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
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
 
Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank  Design by Working Stress - IS Method.pdfIntze Overhead Water Tank  Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - V
 
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
 
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdf
 
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
 

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.