Docsity

CSCI 513 Spring 2009 Assignments 1 and 2: NetBSD Kernel Project, Assignments of Operating Systems

Toggle sidebar
bg1
CSCI 513 – Spring 2009
Systems Programming and Operating Systems Internals
Assignments 1 and 2
Assignment 1: Due: Monday, April 20. 100 points
Answer the following questions about NetBSD kernels and show evidence
you have compiled your own NetBSD kernel.
•How is data transferred between the memory space of a process and
the kernel?
•Describe 4 machine-dependent functions of the kernel.
•What is the difference between a block and a character device?
•Describe a dispatch table and list four places where they are used in
processing the open(2) system call to a device file like /dev/rfd0a.
•Quote the code in open(2) where it processes absolute and relative
path names differently.
•What parts of the character device API are implemented by the satlink
driver?
•When can a routine executing in the top half of the kernel be pre-
empted? When can it be interrupted?
•Describe the kernel functions tsleep() and wakeup().
To show you have compiled your own kernel, print something new during
the startup of NetBSD. You should turn in the output of your dmesg(8) that
shows your new output and a “diff -u” of the source file you changed.
1
pf2

Partial preview of the text

Download CSCI 513 Spring 2009 Assignments 1 and 2: NetBSD Kernel Project and more Assignments Operating Systems in PDF only on Docsity!

CSCI 513 – Spring 2009

Systems Programming and Operating Systems Internals

Assignments 1 and 2

Assignment 1: Due: Monday, April 20. 100 points

Answer the following questions about NetBSD kernels and show evidence you have compiled your own NetBSD kernel.

  • How is data transferred between the memory space of a process and the kernel?
  • Describe 4 machine-dependent functions of the kernel.
  • What is the difference between a block and a character device?
  • Describe a dispatch table and list four places where they are used in processing the open(2) system call to a device file like /dev/rfd0a.
  • Quote the code in open(2) where it processes absolute and relative path names differently.
  • What parts of the character device API are implemented by the satlink driver?
  • When can a routine executing in the top half of the kernel be pre- empted? When can it be interrupted?
  • Describe the kernel functions tsleep() and wakeup().

To show you have compiled your own kernel, print something new during the startup of NetBSD. You should turn in the output of your dmesg(8) that shows your new output and a “diff -u” of the source file you changed.

Assignment 2: Due: Monday, April 27. 150 points

You are to add to NetBSD a “toy” device. The following are the require- ments:

  • It should look like an “isa” device.
  • It should allow only one process to open it at a time.
  • Read() returns data from a predefined string of at least 30 characters. You may choose your string. A read of n characters returns the next n characters in the string and updates a pointer so the next read starts at the next character of the string. If all characters in your string have been returned via a read call, read() should “return an EOF condition.”
  • Write() of any data just ignores the data but resets the read pointer to the first character of the string.
  • Implement an ioctl call for an IOCTL called “TOY IOCTL” which just prints a “hello” message to the console. (You may use “ IO(’Y’, 0)” as the value of the IOCTL.
  • Write a program that shows that your toy works correctly. Remember to show it works for large reads (80+ characters) and for small reads (1 character). Also, it must use TOY IOCTL and show an ioctl() call works.

What to turn in: Your source code for your toy device driver plus a “diff -u” of any files you modified. Also, include a script output of the run of your program. Also, a copy of your dmesg(8) output is needed. (Please e-mail me your source code and diff output. You should still print them out and turn them in. Please use the subject line “CS513 - A2 - Your Name” where “Your Name” is replace by your actual name.