xv6

Debugging user-code on xv6 with gdb

ぐ巨炮叔叔 提交于 2019-12-13 11:43:27
问题 I'm doing an OS class that's based on xv6 and I wrote a program that needs to run on it. I know that I can debug kernel code with make qemu-gdb but I'm not sure how to debug my own user program. Lets say I want to debug cat , how would I go about doing that? Thanks P.S. isn't there an xv6 tag? should this question even go here? 回答1: file cat , break main , continue semi reference running and debugging xv6 回答2: From the xv6 top-level dir: Run the emulator in debug mode (assuming no X11): make

Pass struct to xv6 system call

╄→гoц情女王★ 提交于 2019-12-11 15:55:16
问题 I'm aware which we are not able to pass parameters to xv6 system call directly and we are forced to use it's built in methods. But all examples and questions in this site is about how to send integer to system call. Which it's answer is using argint() method. But my question is, is there anyway to pass "struct" to a xv6 system call? Are there any bulit-in methods for this purpose too? If there is, could you please say a simple example? 回答1: Passing a struct through system call is possible.

XV6 crashes when trying to implement triple indirection in xv6 operating system

寵の児 提交于 2019-12-11 09:47:02
问题 The original xv6-rev7 operating system contains: 12 directed blocks 1 indirect blcok(points to 128 blocks) This means we have 140 blocks. Each block's size is 512KB ==> 512 * 140 = 71,680 ~= 70KB is the limit of file's size in xv6. I want to implemet triple indirect access in xv6 in order to support files with size of 40MB. In order to do it I will need to implement double indirect before the triple indirect. So I took 2 directed blocks from the 12 I had. 1 for the double indirect and the

xv6 Scheduler - proc never != 0

故事扮演 提交于 2019-12-10 11:39:42
问题 Basically, I'm implementing a scheduler for the xv6 kernel that is implementing a multilevel priority queue. I'm having a serious issue I do not understand, the TAs for my course do not understand, and I've missed the deadline for this project, so helping me right now will not gain me any extra points - but I WANT to know why I'm having the following behavior... First, this is the original scheduler that I'm changing for xv6 (for comparison - this is NOT my implementation): // Per-CPU process

number followed by capital L

ⅰ亾dé卋堺 提交于 2019-12-07 07:13:20
问题 What does 512L mean? (or probably any number followed by capital L) example: uint sec and then some code with the expression: sec * 512L (taken out of the XV6 code - mkfs.c) 回答1: L stands for l ong. This creates a literal of type long . l would also work, but it looks like 1 , so it should be avoided. 来源: https://stackoverflow.com/questions/17332477/number-followed-by-capital-l

number followed by capital L

老子叫甜甜 提交于 2019-12-05 16:20:46
What does 512L mean? (or probably any number followed by capital L) example: uint sec and then some code with the expression: sec * 512L (taken out of the XV6 code - mkfs.c) L stands for l ong. This creates a literal of type long . l would also work, but it looks like 1 , so it should be avoided. 来源: https://stackoverflow.com/questions/17332477/number-followed-by-capital-l

Debugging user-code on xv6 with gdb

本秂侑毒 提交于 2019-12-03 13:52:26
I'm doing an OS class that's based on xv6 and I wrote a program that needs to run on it. I know that I can debug kernel code with make qemu-gdb but I'm not sure how to debug my own user program. Lets say I want to debug cat , how would I go about doing that? Thanks P.S. isn't there an xv6 tag? should this question even go here? shevski file cat , break main , continue semi reference running and debugging xv6 From the xv6 top-level dir: Run the emulator in debug mode (assuming no X11): make qemu-nox-gdb In other terminal just run the debugger loading the kernel symbols with: gdb kernel This is

xv6 add a system call that counts system calls

假装没事ソ 提交于 2019-12-01 06:20:56
EDIT: GOT IT here is what I did: in syscall.c: extern int numSysCalls; in sysproc.c: int numSysCalls = -1; Okay, so I'm working on implementing an easy system call that returns the number of times a system call has been made. Seems easy, but I'm getting an error I don't understand... Basically, here is what I did: in syscall.c there is a function called syscall() that checks whether it is a syscall or not. I have basically declared a variable and am incrementing it every time this function is called. Var Declaration in syscall.c: 18: int16_t numSysCalls = -1; //global Syscall() function: 115:

How to compile and run xv6 on windows?

筅森魡賤 提交于 2019-11-30 09:00:54
问题 This question was migrated from Software Engineering Stack Exchange because it can be answered on Stack Overflow. Migrated 8 years ago . We are being taught xv6 in our course. Currently we use to login to linux server of our school using putty in windows. There we make changes in source of xv6 (using vim), then compile and run it in qemu simply make clean make make qemu-nox It is not always possible to connect to their servers therefore I want to be able to compile and run xv6 withing windows

How to compile and run xv6 on windows?

耗尽温柔 提交于 2019-11-29 09:56:32
We are being taught xv6 in our course. Currently we use to login to linux server of our school using putty in windows. There we make changes in source of xv6 (using vim), then compile and run it in qemu simply make clean make make qemu-nox It is not always possible to connect to their servers therefore I want to be able to compile and run xv6 withing windows (in some emulator obviously). What emulator I can use for above kind work? (edit code, compile and run) and how? Well, there are reasonable instructions on how to construct environment for building and using XV6 under Windows in the site