Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
X
xv6-public
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
问题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
银宸时代
OS Lab Group
奖励实验
xv6-public
提交
b7fed77b
提交
b7fed77b
9月 02, 2016
创建
作者:
Frans Kaashoek
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix a few lines that runoff is complaining about that they are too long
上级
5f03799f
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
13 行增加
和
7 行删除
+13
-7
console.c
console.c
+2
-1
fs.c
fs.c
+7
-3
fs.h
fs.h
+4
-3
没有找到文件。
console.c
浏览文件 @
b7fed77b
...
@@ -195,7 +195,8 @@ consoleintr(int (*getc)(void))
...
@@ -195,7 +195,8 @@ consoleintr(int (*getc)(void))
while
((
c
=
getc
())
>=
0
){
while
((
c
=
getc
())
>=
0
){
switch
(
c
){
switch
(
c
){
case
C
(
'P'
):
// Process listing.
case
C
(
'P'
):
// Process listing.
doprocdump
=
1
;
// procdump() locks cons.lock indirectly; invoke later
// procdump() locks cons.lock indirectly; invoke later
doprocdump
=
1
;
break
;
break
;
case
C
(
'U'
):
// Kill line.
case
C
(
'U'
):
// Kill line.
while
(
input
.
e
!=
input
.
w
&&
while
(
input
.
e
!=
input
.
w
&&
...
...
fs.c
浏览文件 @
b7fed77b
...
@@ -22,7 +22,9 @@
...
@@ -22,7 +22,9 @@
#define min(a, b) ((a) < (b) ? (a) : (b))
#define min(a, b) ((a) < (b) ? (a) : (b))
static
void
itrunc
(
struct
inode
*
);
static
void
itrunc
(
struct
inode
*
);
struct
superblock
sb
;
// there should be one per dev, but we run with one dev
// there should be one superblock per disk device, but we run with
// only one device
struct
superblock
sb
;
// Read the super block.
// Read the super block.
void
void
...
@@ -164,8 +166,10 @@ iinit(int dev)
...
@@ -164,8 +166,10 @@ iinit(int dev)
{
{
initlock
(
&
icache
.
lock
,
"icache"
);
initlock
(
&
icache
.
lock
,
"icache"
);
readsb
(
dev
,
&
sb
);
readsb
(
dev
,
&
sb
);
cprintf
(
"sb: size %d nblocks %d ninodes %d nlog %d logstart %d inodestart %d bmap start %d
\n
"
,
sb
.
size
,
cprintf
(
"sb: size %d nblocks %d ninodes %d nlog %d logstart %d\
sb
.
nblocks
,
sb
.
ninodes
,
sb
.
nlog
,
sb
.
logstart
,
sb
.
inodestart
,
sb
.
bmapstart
);
inodestart %d bmap start %d
\n
"
,
sb
.
size
,
sb
.
nblocks
,
sb
.
ninodes
,
sb
.
nlog
,
sb
.
logstart
,
sb
.
inodestart
,
sb
.
bmapstart
);
}
}
static
struct
inode
*
iget
(
uint
dev
,
uint
inum
);
static
struct
inode
*
iget
(
uint
dev
,
uint
inum
);
...
...
fs.h
浏览文件 @
b7fed77b
...
@@ -6,10 +6,11 @@
...
@@ -6,10 +6,11 @@
#define BSIZE 512 // block size
#define BSIZE 512 // block size
// Disk layout:
// Disk layout:
// [ boot block | super block | log | inode blocks | free bit map | data blocks ]
// [ boot block | super block | log | inode blocks |
// free bit map | data blocks]
//
//
// mkfs computes the super block and builds an initial file system. The
super describes
// mkfs computes the super block and builds an initial file system. The
// the disk layout:
//
super block describes
the disk layout:
struct
superblock
{
struct
superblock
{
uint
size
;
// Size of file system image (blocks)
uint
size
;
// Size of file system image (blocks)
uint
nblocks
;
// Number of data blocks
uint
nblocks
;
// Number of data blocks
...
...
编写
预览
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论