Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
X
xv6-public
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
问题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
银宸时代
OS Lab Group
奖励实验
xv6-public
提交
e0966f45
提交
e0966f45
7月 17, 2006
创建
作者:
rsc
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
no more cons_putc; real_cons_putc -> cons_putc
上级
b5ee5165
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
7 行增加
和
18 行删除
+7
-18
console.c
console.c
+7
-17
defs.h
defs.h
+0
-1
没有找到文件。
console.c
浏览文件 @
e0966f45
...
@@ -25,7 +25,7 @@ lpt_putc(int c)
...
@@ -25,7 +25,7 @@ lpt_putc(int c)
}
}
static
void
static
void
real_
cons_putc
(
int
c
)
cons_putc
(
int
c
)
{
{
int
crtport
=
0x3d4
;
// io port of CGA
int
crtport
=
0x3d4
;
// io port of CGA
uint16_t
*
crt
=
(
uint16_t
*
)
0xB8000
;
// base of CGA memory
uint16_t
*
crt
=
(
uint16_t
*
)
0xB8000
;
// base of CGA memory
...
@@ -70,16 +70,6 @@ real_cons_putc(int c)
...
@@ -70,16 +70,6 @@ real_cons_putc(int c)
}
}
void
void
cons_putc
(
int
c
)
{
if
(
use_console_lock
)
acquire
(
&
console_lock
);
real_cons_putc
(
c
);
if
(
use_console_lock
)
release
(
&
console_lock
);
}
void
printint
(
int
xx
,
int
base
,
int
sgn
)
printint
(
int
xx
,
int
base
,
int
sgn
)
{
{
char
buf
[
16
];
char
buf
[
16
];
...
@@ -101,7 +91,7 @@ printint(int xx, int base, int sgn)
...
@@ -101,7 +91,7 @@ printint(int xx, int base, int sgn)
buf
[
i
++
]
=
'-'
;
buf
[
i
++
]
=
'-'
;
while
(
--
i
>=
0
)
while
(
--
i
>=
0
)
real_
cons_putc
(
buf
[
i
]);
cons_putc
(
buf
[
i
]);
}
}
/*
/*
...
@@ -122,7 +112,7 @@ cprintf(char *fmt, ...)
...
@@ -122,7 +112,7 @@ cprintf(char *fmt, ...)
if
(
c
==
'%'
){
if
(
c
==
'%'
){
state
=
'%'
;
state
=
'%'
;
}
else
{
}
else
{
real_
cons_putc
(
c
);
cons_putc
(
c
);
}
}
}
else
if
(
state
==
'%'
){
}
else
if
(
state
==
'%'
){
if
(
c
==
'd'
){
if
(
c
==
'd'
){
...
@@ -135,15 +125,15 @@ cprintf(char *fmt, ...)
...
@@ -135,15 +125,15 @@ cprintf(char *fmt, ...)
char
*
s
=
(
char
*
)
*
ap
;
char
*
s
=
(
char
*
)
*
ap
;
ap
++
;
ap
++
;
while
(
*
s
!=
0
){
while
(
*
s
!=
0
){
real_
cons_putc
(
*
s
);
cons_putc
(
*
s
);
s
++
;
s
++
;
}
}
}
else
if
(
c
==
'%'
){
}
else
if
(
c
==
'%'
){
real_
cons_putc
(
c
);
cons_putc
(
c
);
}
else
{
}
else
{
// Unknown % sequence. Print it to draw attention.
// Unknown % sequence. Print it to draw attention.
real_
cons_putc
(
'%'
);
cons_putc
(
'%'
);
real_
cons_putc
(
c
);
cons_putc
(
c
);
}
}
state
=
0
;
state
=
0
;
}
}
...
...
defs.h
浏览文件 @
e0966f45
...
@@ -6,7 +6,6 @@ void kinit(void);
...
@@ -6,7 +6,6 @@ void kinit(void);
// console.c
// console.c
void
cprintf
(
char
*
fmt
,
...);
void
cprintf
(
char
*
fmt
,
...);
void
panic
(
char
*
s
);
void
panic
(
char
*
s
);
void
cons_putc
(
int
);
// proc.c
// proc.c
struct
proc
;
struct
proc
;
...
...
编写
预览
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论