This is a linux development environment for cs1550 projects.
To download the linuxdev image
docker pull cs1550/linuxdev:latest
For more information: https://www.docker.com/sites/default/files/d8/2019-09/docker-cheat-sheet.pdf
docker run --rm -it -v {absolutepath_to_projectfolder}:/home/ubuntu/project cs1550/linuxdev
cd into the project directory
Build the kernel:
make kernel
Build and run the test programs (to be done once the syscalls are added to syscall_32.tbl):
make debug
Debug
Here is a way to run gdb on Xv6:
make qemu-nox-gdbdocker container lsCONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
2aa06ec5b33c cs1550/xv6 "/bin/bash" 24 seconds ago Up 23 seconds silly_gagarin
docker exec -it <container_id> /bin/bashdocker exec -it 2aa06ec5b33c /bin/bash
cd xv6 and then run gdb on the second terminal using the command:
gdb -iex "set auto-load safe-path ."(gdb) b proc.c:215(gdb) c. This will start the debugging session.(gdb) add-symbol-file _getcount 0(gdb) b getcount.c:7n) you can trace inside kernel code and out to the user code.For sudo access, the default password is ubuntu.
When compiling on a Windows machine, your Linux installation may suffer from clock skew. This will prevent you from compiling.
ubuntu@7d1144ddb629:~/project/project1$ make kernel
make -C linux-5.10.10
make[1]: Entering directory '/home/ubuntu/project/project1/linux-5.10.10'
CALL scripts/checksyscalls.sh
CALL scripts/atomic/check-atomics.sh
CHK include/generated/compile.h
UPD include/generated/compile.h
CC init/version.o
AR init/built-in.a
make[1]: Warning: File 'init/built-in.a' has modification time 18957 s in the future
GEN .version
make[2]: Warning: File 'init/.version.o.cmd' has modification time 18950 s in the future
CHK include/generated/compile.h
UPD include/generated/compile.h
CC init/version.o
AR init/built-in.a
make[2]: warning: Clock skew detected. Your build may be incomplete.
LD vmlinux.o
make[2]: Warning: File 'vmlinux.o' has modification time 19380 s in the future
MODPOST vmlinux.symvers
make[2]: warning: Clock skew detected. Your build may be incomplete.
MODINFO modules.builtin.modinfo
GEN modules.builtin
LD vmlinux
SORTTAB vmlinux
SYSMAP System.map
make[3]: Warning: File 'vmlinux' has modification time 19375 s in the future
To fix this, use Network Time Protocol (ntp) to set the system time from a network time server.
$ sudo apt install ntpdate
And, whenever your Linux clock is wrong, run the following command to sync the time:
$ sudo ntpdate time.windows.com
Content type
Image
Digest
Size
799.8 MB
Last updated
almost 5 years ago
docker pull cs1550/linuxdev