0% found this document useful (0 votes)
39 views9 pages

Tutorial5 Constructing Alarm Clock in Pintos

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
39 views9 pages

Tutorial5 Constructing Alarm Clock in Pintos

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

Operating Systems

Tutorial 5:Constructing
Alarm clock in Pintos
Nguyen Trung Nam (tutor)
Hanoi University of Science and Technology
Compiled with reference to other presentations

Embedded Networking Research Group School of Elec. and Telecom - Hanoi University of Science and Technology
Email: [email protected] C9-411, Dai Co Viet str. 1, HBT, Hanoi Tel: +84-243-8693596
Source Tree Overview

• threads/ : source code for the base


kernel, which you will modify
starting in project 1.
• userprog/ : source code for the user
program loader, which you will
modify starting with project 2.
• vm/ : an almost empty directory,
implement virtual memory here in
project 3.
• filesys/ : source code for the a basic
file system, you will use this file
system starting with project 2,but
will not modify it until project 4.

Embedded Networking Research Group School of Elec. and Telecom - Hanoi University of Science and Technology
Email: [email protected] C9-411, Dai Co Viet str. 1, HBT, Hanoi Tel: +84-243-8693596
Source Tree Overview

• devices/ : source code for I/O device interfacing : keyboard,


timer,disk, etc. Implementation the timer in project 1.
• lib/ : an implementation of a subset of the standard C library.
• lib/kernel/ : Part of the C library that are included only in the
Pintos kernel.
• lib/user/ : part of the C library that are included only in Pintos
user programs.

Embedded Networking Research Group School of Elec. and Telecom - Hanoi University of Science and Technology
Email: [email protected] C9-411, Dai Co Viet str. 1, HBT, Hanoi Tel: +84-243-8693596
Source Tree Overview

• test/ : test of each project,you can modify this code if it helps


you test your submission.
• examples/ : example user programs for use starting with
project 2.
• utils/ & misc/: these files may come in handy if you decide to
try working with Pintos on your own machine. You can ignore
them.

Embedded Networking Research Group School of Elec. and Telecom - Hanoi University of Science and Technology
Email: [email protected] C9-411, Dai Co Viet str. 1, HBT, Hanoi Tel: +84-243-8693596
Building & Running Pintos
• Cd threads/ & typing "make" command.
• Makefile : a copy of
"src/Makefile.build",describes how to build
the kernel.
• kernel.o : result of linking object files complied
from each individual kernel source file into a
single object file.
• kernel.bin : memory image of the kernel,the
exact bytes loaded into memory to run the
Pintos kernel.
• loader.bin : memory image for the kernel
loader,a small chunk of code written in
assembly language that reads the kernel from
disk into memory and starts it up.
• Running Pintos Kernel :
pintos run <project test>

Embedded Networking Research Group School of Elec. and Telecom - Hanoi University of Science and Technology
Email: [email protected] C9-411, Dai Co Viet str. 1, HBT, Hanoi Tel: +84-243-8693596
Tests Kernel Pintos

• Each Pintos project comes


with a set of tests :
- Useful for debugging.
- Also what we will use to
grade your code.
• Use "$make check"
command to run the tests.

Embedded Networking Research Group School of Elec. and Telecom - Hanoi University of Science and Technology
Email: [email protected] C9-411, Dai Co Viet str. 1, HBT, Hanoi Tel: +84-243-8693596
Tests Kernel Pintos

Embedded Networking Research Group School of Elec. and Telecom - Hanoi University of Science and Technology
Email: [email protected] C9-411, Dai Co Viet str. 1, HBT, Hanoi Tel: +84-243-8693596
Debugging Tool

• printf() : easy way to debug


• Assert() : Assert(expression).
• Backtraces : insert a call debug_backtrace() ,prototyped in
<debug.h>

Embedded Networking Research Group School of Elec. and Telecom - Hanoi University of Science and Technology
Email: [email protected] C9-411, Dai Co Viet str. 1, HBT, Hanoi Tel: +84-243-8693596
Pintos Bootup Sequence

• src/threads/init.c -> main()

Embedded Networking Research Group School of Elec. and Telecom - Hanoi University of Science and Technology
Email: [email protected] C9-411, Dai Co Viet str. 1, HBT, Hanoi Tel: +84-243-8693596

You might also like