k0iry / xv6-jos-i386-lab Goto Github PK
View Code? Open in Web Editor NEWAll Labs implementation of 6.828 2018 OS course of MIT.
All Labs implementation of 6.828 2018 OS course of MIT.
make virtual address 0 isn’t mapped for user programs
if we delete check: if(ph.vaddr + ph.memsz < ph.vaddr) in exec.c, how can we exploit the kernel by loading code directly into the kernel space?
Currently I handle the disk operation totally in kernel mode, is it possible to let user space do the handlings?
We passed quite a lot parameters in system calls, can we minimize the work for our code?
in syscall.c, a name table would not be needed
because when we enter the kernel space from user mode, we use spin lock to only let one at a time trap into the kernel. So we add code here in trap.c
if ((tf->tf_cs & 3) == 3) {
lock_kernel();
.....
But with sysenter
fast system call, we also need to do the similar stuff, adding the lock, but it seems a bit tricky here. Need to find a way to add something like below in file trapentry.S:
.text .globl sysenter_handler .type sysenter_handler, @function .align 2 # bypass trap to reach syscall directly sysenter_handler: call spin_lock(&kernel_lock) pushl %edi pushl %ebx pushl %ecx pushl %edx pushl %eax # only support 4 syscall arguments call syscall # movl $0x174, %ecx # movl $0, %edx # movl $(GD_UT), %eax /* no need, because of continuity, GD_UT will be found by adding 16(0x10) to GD_KT */ # wrmsr movl %esi, %edx movl %ebp, %ecx call spin_unlock(&kernel_lock) sysexit
For example, if exec is called to run myprog arg1 and myprog’s first line is #!/interp, then exec runs /interp with command line /interp myprog arg1. Implement support for this convention in xv6.
Maybe need to use qemu-system-x86_64 processor, could go back and have a try, now I just add show memory mapping function
Challenge! You probably have a lot of very similar code right now, between the lists of TRAPHANDLER in trapentry.S and their installations in trap.c. Clean this up. Change the macros in trapentry.S to automatically generate a table for trap.c to use. Note that you can switch between laying down code and data in the assembler by using the directives .text and .data.
drop the big kernel lock, implement these locks:
mainly for CPU alarm handler, see: https://pdos.csail.mit.edu/6.828/2018/homework/xv6-alarm.html
optional challenges.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.