Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
X
xv6-public
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
问题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
银宸时代
OS Lab Group
奖励实验
xv6-public
提交
bf49aedb
提交
bf49aedb
6月 22, 2006
创建
作者:
rtm
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
send console output to parallel port
上级
8352b998
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
22 行增加
和
0 行删除
+22
-0
Notes
Notes
+3
-0
console.c
console.c
+19
-0
没有找到文件。
Notes
浏览文件 @
bf49aedb
bochs 2.2.6:
./configure --enable-smp --enable-disasm --enable-debugger --enable-all-optimizations --enable-4meg-pages --enable-global-pages --enable-pae --disable-reset-on-triple-fault
bootmain.c doesn't work right if the ELF sections aren't
bootmain.c doesn't work right if the ELF sections aren't
sector-aligned. so you can't use ld -N. and the sections may also need
sector-aligned. so you can't use ld -N. and the sections may also need
to be non-zero length, only really matters for tiny "kernels".
to be non-zero length, only really matters for tiny "kernels".
...
...
console.c
浏览文件 @
bf49aedb
...
@@ -2,6 +2,23 @@
...
@@ -2,6 +2,23 @@
#include <x86.h>
#include <x86.h>
#include "defs.h"
#include "defs.h"
/*
* copy console output to parallel port, which you can tell
* .bochsrc to copy to the stdout:
* parport1: enabled=1, file="/dev/stdout"
*/
static
void
lpt_putc
(
int
c
)
{
int
i
;
for
(
i
=
0
;
!
(
inb
(
0x378
+
1
)
&
0x80
)
&&
i
<
12800
;
i
++
)
;
outb
(
0x378
+
0
,
c
);
outb
(
0x378
+
2
,
0x08
|
0x04
|
0x01
);
outb
(
0x378
+
2
,
0x08
);
}
void
void
cons_putc
(
int
c
)
cons_putc
(
int
c
)
{
{
...
@@ -9,6 +26,8 @@ cons_putc(int c)
...
@@ -9,6 +26,8 @@ cons_putc(int c)
unsigned
short
*
crt
=
(
unsigned
short
*
)
0xB8000
;
// base of CGA memory
unsigned
short
*
crt
=
(
unsigned
short
*
)
0xB8000
;
// base of CGA memory
int
ind
;
int
ind
;
lpt_putc
(
c
);
// cursor position, 16 bits, col + 80*row
// cursor position, 16 bits, col + 80*row
outb
(
crtport
,
14
);
outb
(
crtport
,
14
);
ind
=
inb
(
crtport
+
1
)
<<
8
;
ind
=
inb
(
crtport
+
1
)
<<
8
;
...
...
编写
预览
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论