Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
X
xv6-public
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
问题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
银宸时代
OS Lab Group
奖励实验
xv6-public
提交
8e88f9e2
提交
8e88f9e2
8月 24, 2007
创建
作者:
rtm
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
comment nits
上级
4d39b633
显示空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
2 行增加
和
7 行删除
+2
-7
fs.h
fs.h
+1
-1
fsvar.h
fsvar.h
+0
-0
ide.c
ide.c
+1
-6
没有找到文件。
fs.h
浏览文件 @
8e88f9e2
// On-disk file system format.
// On-disk file system format.
//
This header is shared between kernel and user spac
e.
//
Both the kernel and user programs use this header fil
e.
// Block 0 is unused.
// Block 0 is unused.
// Block 1 is super block.
// Block 1 is super block.
...
...
fsvar.h
浏览文件 @
8e88f9e2
ide.c
浏览文件 @
8e88f9e2
...
@@ -18,10 +18,9 @@
...
@@ -18,10 +18,9 @@
#define IDE_CMD_READ 0x20
#define IDE_CMD_READ 0x20
#define IDE_CMD_WRITE 0x30
#define IDE_CMD_WRITE 0x30
// IDE request queue.
// ide_queue points to the buf now being read/written to the disk.
// ide_queue points to the buf now being read/written to the disk.
// ide_queue->qnext points to the next buf to be processed.
// ide_queue->qnext points to the next buf to be processed.
//
M
ust hold ide_lock while manipulating queue.
//
You m
ust hold ide_lock while manipulating queue.
static
struct
spinlock
ide_lock
;
static
struct
spinlock
ide_lock
;
static
struct
buf
*
ide_queue
;
static
struct
buf
*
ide_queue
;
...
@@ -84,7 +83,6 @@ ide_intr(void)
...
@@ -84,7 +83,6 @@ ide_intr(void)
{
{
acquire
(
&
ide_lock
);
acquire
(
&
ide_lock
);
if
(
ide_queue
){
if
(
ide_queue
){
//cprintf("intr %x\n", ide_queue);
if
((
ide_queue
->
flags
&
B_WRITE
)
==
0
)
if
((
ide_queue
->
flags
&
B_WRITE
)
==
0
)
if
(
ide_wait_ready
(
1
)
>=
0
)
if
(
ide_wait_ready
(
1
)
>=
0
)
insl
(
0x1F0
,
ide_queue
->
data
,
512
/
4
);
insl
(
0x1F0
,
ide_queue
->
data
,
512
/
4
);
...
@@ -105,7 +103,6 @@ ide_start_request (void)
...
@@ -105,7 +103,6 @@ ide_start_request (void)
{
{
if
(
ide_queue
){
if
(
ide_queue
){
ide_wait_ready
(
0
);
ide_wait_ready
(
0
);
//cprintf("start %x\n", ide_queue);
outb
(
0x3f6
,
0
);
// generate interrupt
outb
(
0x3f6
,
0
);
// generate interrupt
outb
(
0x1F2
,
1
);
// number of sectors
outb
(
0x1F2
,
1
);
// number of sectors
outb
(
0x1F3
,
ide_queue
->
sector
&
0xFF
);
outb
(
0x1F3
,
ide_queue
->
sector
&
0xFF
);
...
@@ -139,8 +136,6 @@ ide_rw(struct buf *b)
...
@@ -139,8 +136,6 @@ ide_rw(struct buf *b)
b
->
done
=
0
;
b
->
done
=
0
;
b
->
qnext
=
0
;
b
->
qnext
=
0
;
// cprintf("enqueue %x %x\n", b, ide_queue);
// append b to ide_queue
// append b to ide_queue
pp
=
&
ide_queue
;
pp
=
&
ide_queue
;
while
(
*
pp
)
while
(
*
pp
)
...
...
编写
预览
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论