Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
268 views10 pages

Nachos MP1

This document provides instructions for a NachOS assignment that involves implementing four file I/O system calls - Open, Write, Read, and Close. It details the requirements, grading criteria, deadlines, files to modify, and FAQs. A successful implementation of fileIO_test1 should generate a file called "file1.test" and fileIO_test2 should display a "^_^" mark. The deadline for submission is October 18, 2015 at 23:59 with penalties for late work.

Uploaded by

黃昱婷
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)
268 views10 pages

Nachos MP1

This document provides instructions for a NachOS assignment that involves implementing four file I/O system calls - Open, Write, Read, and Close. It details the requirements, grading criteria, deadlines, files to modify, and FAQs. A successful implementation of fileIO_test1 should generate a file called "file1.test" and fileIO_test2 should display a "^_^" mark. The deadline for submission is October 18, 2015 at 23:59 with penalties for late work.

Uploaded by

黃昱婷
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/ 10

NachOS-MP1

Lecturer: Jerry Chou


TA: Cake, Vincent
National Tsing Hua University

Grading
Program correctness Demo (on Server)
console I/O 20%, file I/O 40%

Work item 1: tracing system call 25%


save it as a PDF

explain how system calls go through NachOS in detail

Work item 2: report 15%


explain your work (modifications of the code, team member contribution, )

Deadline: 2015/10/18(Sunday) 23:59, penalty for late submission


You can discuss, but do not copy. 0 will be given to cheaters.

Assignment Part II
You should NOT use standard library IO functions in any part of Nachos
e.g. open(), close(), read(), write(), fread(), fwrite(),

A successful run of fileIO_test1 will generate an file file1.test


content in file1.test

Assignment Part II
A successful run of fileIO_test2 should look like this

You will get a ^_^ mark if you pass the test


Disk I/O remains 0 , since we are now using LINUX backed file system
We will implement it in MP4, coming sooooooon~

Assignment Part II
For second part, you have to implement four file I/O system call
OpenFileId Open(char *name);
open a file with the name and return its fileId

int Write(char *buffer, int size, OpenFileId id);


write size characters from buffer into the file

return number of characters actually written to the file

int Read(char *buffer, int size, OpenFileId id);


read size characters from the file and copy them into buffer

return number of characters actually read from the file

int Close(OpenFileId id);


return 1 if successfully close the file, 0 otherwise

Hint part II
Trace how Create() system call works, this will help you a lot.
Return value is important!!!
Files to modify
userprog/syscall.h, exception.cc, ksyscall.h

machine/console, interrupt
filesys/filesys, openfile
threads/kernel

You can not directly use the pointer of a user program, remember to
translate it before using them in kernel!!!

FAQ
Q1: cannot login or cannot connect to server
A1: Please contact TA, do not try to guess your password by brute force.
(We may ban your IP for safety issues)

Q2: xxx: permission denied


A2: change the target program permission via command chmod
e.g. >chmod 775 ./my_program

FAQ
Q3: I modified code in nachos, but nothing seems changed?
A3: Be sure you do not get any errors during make. (You can ignore
warning messages) And always remember to make after you
modify anything in Nachos.

Q4. How do I create my testing program?


A4. Please modify the provided testing files and make, or you can learn
how to write/modify a makefile. Do not compile your testing code with
gcc, this will make the binary unrunnable on Nachos!!!

FAQ
Q5: My process got stuck, how do I escape?
A5: press [ctrl] + C to kill the process.

Q6: Do TAs help debug my Nachos?


A6: No, we only discuss concept with you. You can still ask questions
about weird error messages.

If you have other questions, feel free to ask on iLMS.

Reference
Linux command
http://linux.vbird.org/linux_basic/0220filemanager.php

vim command
http://linux.vbird.org/linux_basic/0310vi.php

NachOS
http://homes.cs.washington.edu/~tom/nachos/

You might also like