ecs150 Fall 2005: Discussion - PowerPoint PPT Presentation

About This Presentation
Title:

ecs150 Fall 2005: Discussion

Description:

... images on the web site. Make sure that the CD's are OK 'kernel development' package. If vmware/virtual PC, you can access the CD images as virtual CDs. 01/09/2006 ... – PowerPoint PPT presentation

Number of Views:19
Avg rating:3.0/5.0
Slides: 13
Provided by: astpr
Category:

less

Transcript and Presenter's Notes

Title: ecs150 Fall 2005: Discussion


1
ecs150 Fall 2005Discussion1 Assignment
  • Dr. S. Felix Wu
  • Computer Science Department
  • University of California, Davis
  • http//www.cs.ucdavis.edu/wu/
  • sfelixwu_at_gmail.com

2
Two Parts
  • The Programming part
  • The tracing Writing part
  • /usr/src/sys/
  • /usr/src/sys/kern/.c
  • /usr/src/sys/sys/proc.h
  • /usr/src/sys/i386/i386/.cs

3
FreeBSD Installation
  • 5.4 CD iso-images on the web site
  • Make sure that the CDs are OK
  • kernel development package
  • If vmware/virtual PC, you can access the CD
    images as virtual CDs.

4
Compiling the Kernel
  • Before you compile
  • Follow the direction in the website
  • The MYKERNEL configuration
  • /usr/src/sys/i386/compile/MYKERNEL
  • make dep
  • Only ONCE unless you add new .h dependency
  • make all
  • make install

5
/kernel ? /kernel.old
  • On every new kernel installation
  • ? KEEP ONE GOOD KERNEL
  • /kernel ? /kernel.good
  • press 6 to escape and use the boot option to
  • boot kernel.good

6
KLD
  • kldstat
  • kldload
  • kldunload

7
System Entry Vector
fork()
Trap

8
System Entry Vector
fork()
Trap
Reserved for loadable system calls

XYZ()
9
kldload
fork()
Trap
XYZ()

10
kld examples
  • See the web link for more info
  • helloworld.c
  • call.c
  • Makefile

11
Modifying proc.h
  • Add to the zero section.

12
One trick ? struct proc
  • PID ? struct proc

struct proc p1 p1 pfind(uap-gtpid) if
(p1) p1-gttickets uap-gttickets PROC_UNLOCK(p
1)
Write a Comment
User Comments (0)
About PowerShow.com