Skip to content

MarschildX/xv6-editor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 

Repository files navigation

xv6-editor

NOTICE: My xv6 runs in QEMU simulator.

The folder xv6_all_files contains all the original code and all the executable file of xv6-rev7(release version 7) system.

editor.c file contains the main code of my simple editor.

The simple editor can simply highlight the C language. Its effect is demostrated below.

code highlight demo

This editor can mostly undo 20 steps sequently. It depends on the variable MAX_ROLLBACK_STEP. If you want more undo step, just extend this variable. There is a small bug with undo delete command. Unfortunately, it still has not been resolved though I have paid a lot of time on it. I suspect that I triggered a unfound system bug. Who knows? But don't worry about that. This small bug just limit our ability to undo the delete operation and I have forbidden this function. The other function wouldn't be affected. So you can use this editor safely. I have mark the code which with bug in the editor.c.

Furthermore, press help instruction for more operating detail. All the operations are here.

help info


How to install xv6?

Execute the following instructions sequently.

1. Install the gdb and gcc.

sudo apt-get install -y build-essential gdb 
sudo apt-get install gcc-multilib

2. Install QEMU simulator.

sudo apt-get install qemu

3. Clone origin xv6 code from github.

git clone git://github.com/mit-pdos/xv6-public.git

4. Rollback to rev7 version.

tips: rev7 version is more stable and reliable.

cd xv6-public-master
git checkout -b xv6-rev7 xv6-rev7

5. Open the Makefile file, find the following line and complete it.

QEMU = qemu-system-x86_64

6. Now you can compile xv6 system.

make

7. If you see the following info, Congratulations! you have successfully compiled it.

successfully compiled info

8. Now you can open xv6 and enjoy it.

make qemu-nox

Running


There is still a problem existing. How to compile xv6 with your own C file?

We should know the fact that how make instruction compiles xv6 system is depending on Makefile. So we should add something properly to Makefile file.

  1. Open Makefile file.

  2. Find out the following two parts of code and add the content which circled with red box.

    revise_Makefile_1

    revise_Makefile_2

  3. Then save Makefile and compile xv6 again.