Nachos Project 1 Start-up and System call

Slides:



Advertisements
Similar presentations
Lab III – Linux at UMBC.
Advertisements

Linux commands exercise 1. What do you need, if you try to these at home? You need to download and install Ubuntu Linux from the Internet – DVD is need.
Module R2 CS450. Next Week R1 is due next Friday ▫Bring manuals in a binder - make sure to have a cover page with group number, module, and date. You.
Zhang Hongyi CSCI2100B Data Structures Tutorial 2
CSCI 1411 FUNDAMENTALS OF COMPUTING LAB Lab Introduction 1 Shane Transue MSCS.
Project 1CS-3013 A-term Programming Project #1 Forking Processes Due Tuesday, September 8, 11:59 PM.
Introduction to Java Lab CS110A – Lab Section 004 Instructor: Duo Wei.
Nachos Introduction CS Operating System 2007.
CS1020: Intro Workshop. Topics CS1020Intro Workshop Login to UNIX operating system 2. …………………………………… 3. …………………………………… 4. …………………………………… 5. ……………………………………
Dayu Zhang 9/3/2014 Lab01. Lab Instructor: Dayu Zhang Office Hour Mon/Wed 10:40am – 11:10am Room A201 Lab Website
UPLOADING YOUR SERVER CODE TO YOUR VIRTUAL MACHINE.
Nachos Introduction CS Operating System 2005.
CSCI S-1 Section 3. Deadlines for Homework 2 Problems 1-8 in Parts C and D – Friday, July 3, 17:00 EST Parts E and F – Tuesday, July 7, 17:00 EST.
Linux Basics. What is an Operating System (OS)? An Operating System (OS) is an interface between hardware and user which is responsible for the management.
1 SEEM3460 Tutorial Unix Introduction. 2 Introduction What is Unix? An operation system (OS), similar to Windows, MacOS X Why learn Unix? Greatest Software.
L INUX C OMMAND L INE I NTERFACE G UNAANBAN.G
Using Macs and Unix Nancy Griffeth January 6, 2014 Funding for this workshop was provided by the program “Computational Modeling and Analysis of Complex.
NCHU System & Network Lab Lab 3 System Call Operating System Lab.
Operating System Program 5 I/O System DMA Device Driver.
Lab 3 Department of Computer Science and Information Engineering National Taiwan University Lab3 - Cross Tools 2014/10/7/ 20 1.
Operating Systems Nachos Project 2 Thread Scheduling.
Help session: Unix basics Keith 9/9/2011. Login in Unix lab  User name: ug0xx Password: ece321 (initial)  The password will not be displayed on the.
For OS Experiments. What Do We Need? A Computer &
POS/420 Introduction to Unix Philip Robbins – March 12, 2013 (Week 1)
Embedded Linux porting Kernel
Functions and More. Homework 1 Due September 11:59pm return a string count characters in a string call functions in a function.
Nachos Projects Overview and Project 1 TA : 吳哲榮 2010/10/21.
Project 1, Command Shell CS-502 (EMC) Fall Programming Project #1 Command Shell CS-502, Operating Systems EMC, Fall 2009 (Slides include materials.
CS OPERATING SYSTEMS Project 2 Matrix Multiplication Project.
Nachos Assignment#1 System calls implementation. What are system calls? Enable you to interact with OS kernel. A switch from User Mode to Kernel Mode.
FTP Server and FTP Commands By Nanda Ganesan, Ph.D. © Nanda Ganesan, All Rights Reserved.
Nachos Projects Overview and Project 1 TA : 王映智 2007/10/24.
PROGRAMMING PROJECT POLICIES AND UNIX INTRO Sal LaMarca CSCI 1302, Fall 2009.
AE6382 Secure Shell Usually referred to as ssh, the name refers to both a program and a protocol. The program ssh is one of the most useful networking.
Nachos Project Assignment 1 MultiprogrammingTA:mamafun.
ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU Usage of Workstation Lecturer: Yu-Hao( 陳郁豪 ) Date:
ENEE150 – 0202 ANDREW GOFFIN Introduction to ENEE150.
Nachos Project Assignment 2 CPU scheduling
Nachos Project 4 Lecturer: Hao-Hua Chu TA: Chun-Po Wang (Artoo) Date: 2008/10/25.
Basic Unix Commands CGS 3460, Lecture 6 Jan 23, 2006 Zhen Yang.
NTU CSIE Computer Networks 2009 Spring Project 2 Internet Relay Chat (IRC)
City Cluster Quickstart Lien-Chi Lai, COLA Lab, Department of Mathematics, NTU 2010/05/11.
Nachos Project Assignment 1 Multi-programming TA: Hung-Leng Chen.
Nachos Overview Lecturer: Hao-Hua Chu TA: Chun-Po Wang (Artoo) Date: 2008/09/18 Material Provided by Yuan-Hao Chang, Yung-Feng Lu.
OS Project 0 February 25, Outline  Linux Installation  Linux Kernel Compilation  System Call Development  Kernel Modules / 452.
| nectar.org.au NECTAR TRAINING Module 10 Beyond the Dashboard.
Lab 12 Department of Computer Science and Information Engineering National Taiwan University Lab12 – Driver 2014/12/16 1 /21.
Unix Servers Used in This Class  Two Unix servers set up in CS department will be used for some programming projects  Machine name: eustis.eecs.ucf.edu.
Dr. Sajib Datta CSE Spring 2016 INTERMEDIATE PROGRAMMING.
 Prepared by: Eng. Maryam Adel Abdel-Hady
ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU Usage of Workstation Lecturer: Yu-Hao( 陳郁豪 ) Date:
1 COMP 3500 Introduction to Operating Systems Project 4 – Processes and System Calls Part 3: Adding System Calls to OS/161 Dr. Xiao Qin Auburn University.
Linux CSE 1222 CSE1222: Lecture 1BThe Ohio State University1.
Assignprelim.1 Assignment Preliminaries © 2012 B. Wilkinson/Clayton Ferner. Modification date: Jan 16a, 2014.
Precept I : Lab Environment, Unix, Bash, Emacs
Unix Environment Basics CSCI-1302
Tutorial of Unix Command & shell scriptS 5027
EE516: Embedded Software Project 1
CS1010: Intro Workshop.
Mixture Density and Project 1 Discussion 02/01/17
Lab 1 introduction, debrief
CSE1320 INTERMEDIATE PROGRAMMING
CSE1320 INTERMEDIATE PROGRAMMING
CSE1320 INTERMEDIATE PROGRAMMING
CSE1320 INTERMEDIATE PROGRAMMING
Programming Project #1 Command Shell
Programming Project #1 Fork and Command Shell
CSCE 206 Lab Structured Programming in C
Nachos Project Assignment 2 CPU scheduling
Presentation transcript:

Nachos Project 1 Start-up and System call CS 342302 OPERATING SYSTEMS Nachos Project 1 Start-up and System call

MOTIVATION System calls are the interfaces that user programs can ask services from kernel. How to add a new system call is very essential.

OBJECTIVE Be familiar with the Nachos environment. Design and implement new system calls in this project.

PLATFORM Use Linux on our server. You could also build up your Linux environment by yourself.

LOGIN Download pietty (http://ntu.csie.org/~piaip/pietty/) Server IP : 140.114.71.238 PORT : 35568 需更改

LOGIN 如出現以下畫面 選 “是(Y)”

LOGIN Both the account name and the default password are “os”+your student number. (ex. os9862518) After you login, you must change your password. (use passwd command) $passwd

BASIC COMMAND NOTE : Some basic commands you have to know: for example : $cd <directory> : enter directory $cd .. : go back to upper directory $cd ~ : enter home directory $ctrl + c : process termination good place : 鳥哥的 Linux 私房菜 (http://linux.vbird.org/)

COMPLETE YOUR NACHOS ENVIRONMENT Enter your home directory $ cd ~ We have already prepared for you nachos-java.tar.gz , nachos-java.tar.gz Decompress it! $ tar zxvf nachos-java.tar.gz $ tar zxvf mips-x86.linux-xgcc.tgz Enter the nachos/test directory and execute make. If there is no errors, your MIPS cross compiler environment is set correctly. $ cd nachos/test $ make

MAKE RESULT Note: If there are errors when you make, contact TA please. Otherwise, you couldn’t complete this project

EXECUTE NACHOS Go back and enter the proj1 directory and execute make. It will create the directory named nachos. Finally, execute nachos to run Nachos, you will see some lines of messages when running. $ cd .. $ cd proj1 $ make $ nachos

RUNNING RESULT If there is no error so far, your Nachos environment is set successfully.

HOW TO MODIFY Use vim on the server (suggested) Reference : http://www.study-area.org/tips/vim/ http://linux.vbird.org/linux_basic/0310vi.php Or you can use the FTP software (ex. FileZilla) with SSH (port:22) to download and upload the file which have to be modify, then you can use your own editor in your operating system.

BASIC REQUIREMENT IMPLEMENT & ADD THE FOLLOWING SYSTEM CALL: int add(int op1, int op2); int pow(int op1, int op2); void print(char *msg); void print2(char *msg, int value); You only need to parse the parameter %d. void exit(int status); In order to terminate user programs properly.

RELATED CODE FOR USER PROCESSES ~/nachos/test/start.S Startup assembly code for every user program of Nachos. ~/nachos/test/syscall.h Definitions of the system call prototypes ~/nachos/userprog/UserProcess.java Encapsulates the state of a user process, including the handler for system calls and other exceptions.

ADD YOUR SYSTEM CAL Declare a new system call in test/syscall.h - Define a new system call ID E.g., #define syscallAdd 13 - Declare the interface for Nachos system calls, which will be called by the user program. E.g., int add(int op1, int op2); Add the low level operation to support the new declared system call in test/start.S E.g., SYSCALLSTUB(add, syscallAdd)

ADD YOUR SYSTEM CALL handleSyscall in userprog/UserProcess.java 1. Define system call ID which you’ve defined in UserProcess.java private static final int syscallHalt = 0, ….. 2. Write your system call in the switch case public int handleSyscall (int syscall, int a0, int a1, int a2, int a3) { switch (syscall) { case syscallAdd: return a0+a1;

ADD YOUR PROGRAM You have to run the following test program on your Nachos.

ADD YOUR PROGRAM(CONT.) If you call the test file “proj1.c”. First, put the file under /test, and modify the file “Makefile”. TARGETS = halt sh matmult sort echo cat cp mv rm #chat chatserver  TARGETS = halt sh matmult sort echo cat cp mv rm proj1 #chat chatserver then “make” again under the /test directory. If appear “make: Nothing to be done for `all'.” $ make clean $ make

RUN YOUR PROGRAM In file ~/nachos/proj2 Then modify the line 12 of /proj2/nachos.conf Kernel.shellProgram = halt.coff #sh.coff  Kernel.shellProgram = proj1.coff #sh.coff “make” under /proj2. Enter “nachos” to run it.

RESULT

HINT In system call “print” and “print2” may use the functions below: readVirtualMemoryString(); System.out.println(); try to know how to use it

SUBMISSION & GRADING POLICY Code correctness 65% Every system call is 13% Readability 5% Report 30% Bonus 10%

BONUS Anything different from Basic Requirement Build your own nachos' environment For example : Using Vmware, install Ubuntu, nachos, mips …etc. Another system call Create, open, write, read …etc.

REPORT REQUIREMENT Free but basically What problem have you met and how to solve it What have you learned from this project Your bonus part (if have, Explain it in detail) 報告越詳細分數越高

DEADLINE 2009 / 10 / 21 ( 23:59 pm)

office hour : 週一 (Mon) : 7:00pm~10:00pm 綜二 751

REFERENCES 鳥哥的 Linux 私房菜 Linux 基本操作