Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
X
xv6-public
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
问题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
银宸时代
OS Lab Group
奖励实验
xv6-public
提交
e958c538
提交
e958c538
8月 15, 2006
创建
作者:
kaashoek
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
commented out code for cwd
上级
d7b3b802
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
24 行增加
和
4 行删除
+24
-4
console.c
console.c
+1
-1
defs.h
defs.h
+2
-0
fs.c
fs.c
+8
-0
fs.h
fs.h
+2
-0
init.c
init.c
+2
-1
main.c
main.c
+5
-2
proc.c
proc.c
+3
-0
proc.h
proc.h
+1
-0
没有找到文件。
console.c
浏览文件 @
e958c538
...
...
@@ -160,7 +160,7 @@ panic(char *s)
{
__asm
__volatile
(
"cli"
);
use_console_lock
=
0
;
cprintf
(
"panic
: "
);
cprintf
(
"panic
(%d): "
,
cpu
()
);
cprintf
(
s
,
0
);
cprintf
(
"
\n
"
,
0
);
panicked
=
1
;
// freeze other CPU
...
...
defs.h
浏览文件 @
e958c538
...
...
@@ -110,11 +110,13 @@ void bwrite(struct buf *, uint);
void
brelse
(
struct
buf
*
);
// fs.c
extern
uint
rootdev
;
void
iinit
(
void
);
struct
inode
*
iget
(
uint
dev
,
uint
inum
);
void
ilock
(
struct
inode
*
ip
);
void
iunlock
(
struct
inode
*
ip
);
void
idecref
(
struct
inode
*
ip
);
void
iincref
(
struct
inode
*
ip
);
void
iput
(
struct
inode
*
ip
);
struct
inode
*
namei
(
char
*
path
,
int
,
uint
*
);
void
stati
(
struct
inode
*
ip
,
struct
stat
*
st
);
...
...
fs.c
浏览文件 @
e958c538
...
...
@@ -287,6 +287,14 @@ idecref(struct inode *ip)
}
void
iincref
(
struct
inode
*
ip
)
{
ilock
(
ip
);
ip
->
count
++
;
iunlock
(
ip
);
}
void
stati
(
struct
inode
*
ip
,
struct
stat
*
st
)
{
st
->
st_dev
=
ip
->
dev
;
...
...
fs.h
浏览文件 @
e958c538
...
...
@@ -36,3 +36,5 @@ struct dirent {
ushort
inum
;
char
name
[
DIRSIZ
];
};
init.c
浏览文件 @
e958c538
#include "user.h"
#include "types.h"
#include "stat.h"
#include "user.h"
#include "fs.h"
#include "fcntl.h"
...
...
main.c
浏览文件 @
e958c538
...
...
@@ -68,13 +68,14 @@ main0(void)
p
->
sz
=
4
*
PAGE
;
p
->
mem
=
kalloc
(
p
->
sz
);
memset
(
p
->
mem
,
0
,
p
->
sz
);
p
->
kstack
=
kalloc
(
KSTACKSIZE
);
p
->
tf
=
(
struct
trapframe
*
)
(
p
->
kstack
+
KSTACKSIZE
-
sizeof
(
struct
trapframe
))
;
p
->
kstack
=
kalloc
(
KSTACKSI
b
ZE
);
p
->
tf
=
(
struct
trapframe
*
)
(
p
->
kstack
+
KSTACKSIZE
)
-
1
;
memset
(
p
->
tf
,
0
,
sizeof
(
struct
trapframe
));
p
->
tf
->
es
=
p
->
tf
->
ds
=
p
->
tf
->
ss
=
(
SEG_UDATA
<<
3
)
|
3
;
p
->
tf
->
cs
=
(
SEG_UCODE
<<
3
)
|
3
;
p
->
tf
->
eflags
=
FL_IF
;
setupsegs
(
p
);
// curproc[cpu()] = p;
// initialize I/O devices, let them enable interrupts
console_init
();
...
...
@@ -90,6 +91,8 @@ main0(void)
cpus
[
cpu
()].
nlock
--
;
sti
();
// p->cwd = iget(rootdev, 1);
// iunlock(p->cwd);
p
=
copyproc
(
&
proc
[
0
]);
//load_icode(p, _binary_usertests_start, (uint) _binary_usertests_size);
...
...
proc.c
浏览文件 @
e958c538
...
...
@@ -124,6 +124,9 @@ copyproc(struct proc* p)
fd_incref
(
np
->
fds
[
i
]);
}
// np->cwd = p->cwd;
// iincref(p->cwd);
return
np
;
}
...
...
proc.h
浏览文件 @
e958c538
...
...
@@ -46,6 +46,7 @@ struct proc{
void
*
chan
;
// sleep
int
killed
;
struct
fd
*
fds
[
NOFILE
];
struct
inode
*
cwd
;
struct
taskstate
ts
;
// only to give cpu address of kernel stack
struct
segdesc
gdt
[
NSEGS
];
...
...
编写
预览
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论