add zombie program
This commit is contained in:
parent
a7d18bb6f0
commit
349ee132f0
2 changed files with 23 additions and 5 deletions
16
Makefile
16
Makefile
|
@ -33,7 +33,8 @@ CC = $(TOOLPREFIX)gcc
|
||||||
LD = $(TOOLPREFIX)ld
|
LD = $(TOOLPREFIX)ld
|
||||||
OBJCOPY = $(TOOLPREFIX)objcopy
|
OBJCOPY = $(TOOLPREFIX)objcopy
|
||||||
OBJDUMP = $(TOOLPREFIX)objdump
|
OBJDUMP = $(TOOLPREFIX)objdump
|
||||||
CFLAGS = -fno-builtin -O2 -Wall -MD
|
# On newer gcc you may need to add -fno-stack-protector to $(CFLAGS)
|
||||||
|
CFLAGS = -fno-builtin -O2 -Wall -MD -fno-stack-protector
|
||||||
AS = $(TOOLPREFIX)gas
|
AS = $(TOOLPREFIX)gas
|
||||||
|
|
||||||
xv6.img : bootblock kernel fs.img
|
xv6.img : bootblock kernel fs.img
|
||||||
|
@ -99,19 +100,24 @@ _rm : rm.o $(ULIB)
|
||||||
$(LD) -N -e main -Ttext 0 -o _rm rm.o $(ULIB)
|
$(LD) -N -e main -Ttext 0 -o _rm rm.o $(ULIB)
|
||||||
$(OBJDUMP) -S _rm > rm.asm
|
$(OBJDUMP) -S _rm > rm.asm
|
||||||
|
|
||||||
|
_zombie: zombie.o $(ULIB)
|
||||||
|
$(LD) -N -e main -Ttext 0 -o _zombie zombie.o $(ULIB)
|
||||||
|
$(OBJDUMP) -S _zombie > zombie.asm
|
||||||
|
|
||||||
mkfs : mkfs.c fs.h
|
mkfs : mkfs.c fs.h
|
||||||
cc -o mkfs mkfs.c
|
cc -o mkfs mkfs.c
|
||||||
|
|
||||||
fs.img : mkfs usertests _echo _cat README _init _sh _ls _mkdir _rm
|
UPROGS=usertests _echo _cat _init _sh _ls _mkdir _rm _zombie
|
||||||
./mkfs fs.img usertests _echo _cat README _init _sh _ls _mkdir _rm
|
fs.img : mkfs README $(UPROGS)
|
||||||
|
./mkfs fs.img README $(UPROGS)
|
||||||
|
|
||||||
-include *.d
|
-include *.d
|
||||||
|
|
||||||
clean :
|
clean :
|
||||||
rm -f *.ps *.tex *.dvi *.idx *.aux *.log *.ind *.ilg \
|
rm -f *.ps *.tex *.dvi *.idx *.aux *.log *.ind *.ilg \
|
||||||
*.o *.d *.asm vectors.S parport.out \
|
*.o *.d *.asm vectors.S parport.out \
|
||||||
bootblock kernel xv6.img usertests \
|
bootblock kernel xv6.img fs.img mkfs \
|
||||||
fs.img _cat _echo _init _sh _ls _rm _mkdir mkfs
|
$(UPROGS)
|
||||||
|
|
||||||
# make a printout
|
# make a printout
|
||||||
PRINT = \
|
PRINT = \
|
||||||
|
|
12
zombie.c
Normal file
12
zombie.c
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
// Create a zombie process.
|
||||||
|
|
||||||
|
#include "types.h"
|
||||||
|
#include "stat.h"
|
||||||
|
#include "user.h"
|
||||||
|
|
||||||
|
int
|
||||||
|
main(void)
|
||||||
|
{
|
||||||
|
fork();
|
||||||
|
exit();
|
||||||
|
}
|
Loading…
Reference in a new issue