Giter Site home page Giter Site logo

xv6-jos-i386-lab's Introduction

Hi there 👋

xv6-jos-i386-lab's People

Contributors

k0iry avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

xv6-jos-i386-lab's Issues

exploit the kernel

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?

Optimize code for disk interrupt driver

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?

sysenter spinlock

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

support interpreter like #!

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.

tidy up trap handler code, remove similar code

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.

implement fine-grained locking in JOS

drop the big kernel lock, implement these locks:

  • page free list lock for memory allocation and deallocation
  • scheduler lock for running processes on SMP
  • console lock for printing messages
  • ipc lock for inter-process communication

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.