Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
X
xv6-public
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
问题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
银宸时代
OS Lab Group
奖励实验
xv6-public
提交
9bbaf1df
提交
9bbaf1df
2月 10, 2012
创建
作者:
Nickolai Zeldovich
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
all c++ userspace except for system calls and lwip
上级
bfea5822
隐藏空白字符变更
内嵌
并排
正在显示
24 个修改的文件
包含
13 行增加
和
41 行删除
+13
-41
Makefile
Makefile
+1
-1
cat.cc
cat.cc
+0
-2
dirbench.cc
dirbench.cc
+0
-2
echo.cc
echo.cc
+0
-2
forkexecbench.cc
forkexecbench.cc
+0
-2
forkexectree.cc
forkexectree.cc
+0
-2
forktree.cc
forktree.cc
+0
-2
httpd.cc
httpd.cc
+0
-2
init.cc
init.cc
+0
-2
lockstat.cc
lockstat.cc
+0
-2
ls.cc
ls.cc
+0
-2
mapbench.cc
mapbench.cc
+0
-2
maptest.cc
maptest.cc
+1
-1
printf.cc
printf.cc
+3
-3
sh.cc
sh.cc
+0
-2
sleep.cc
sleep.cc
+0
-2
telnetd.cc
telnetd.cc
+0
-2
thrtest.cc
thrtest.cc
+0
-2
time.cc
time.cc
+0
-2
ulib.cc
ulib.cc
+2
-2
umalloc.cc
umalloc.cc
+0
-0
unet.h
unet.h
+2
-0
user.h
user.h
+4
-0
usertests.cc
usertests.cc
+0
-2
没有找到文件。
Makefile
浏览文件 @
9bbaf1df
...
...
@@ -26,7 +26,7 @@ COMFLAGS := -fno-pic -static -fno-builtin -fno-strict-aliasing -O2 -Wall \
-DHW_
$(HW)
-include
param.h
-include
compiler.h
COMFLAGS
+=
$(
shell
$(CC)
-fno-stack-protector
-E
-x
c /dev/null
>
/dev/null 2>&1
&&
echo
-fno-stack-protector
)
CFLAGS
:=
$(COMFLAGS)
-std
=
c99
CXXFLAGS
:=
$(COMFLAGS)
-std
=
c++0x
CXXFLAGS
:=
$(COMFLAGS)
-std
=
c++0x
-Wno-sign-compare
ASFLAGS
=
-m64
-gdwarf-2
-MD
LDFLAGS
+=
-m
elf_x86_64
...
...
cat.cc
浏览文件 @
9bbaf1df
extern
"C"
{
#include "types.h"
#include "stat.h"
#include "user.h"
}
char
buf
[
512
];
...
...
dirbench.cc
浏览文件 @
9bbaf1df
extern
"C"
{
#include "types.h"
#include "stat.h"
#include "user.h"
#include "mtrace.h"
#include "amd64.h"
#include "fcntl.h"
}
enum
{
nthread
=
2
};
enum
{
nloop
=
100
};
...
...
echo.cc
浏览文件 @
9bbaf1df
extern
"C"
{
#include "types.h"
#include "stat.h"
#include "user.h"
}
int
main
(
int
argc
,
char
*
argv
[])
...
...
forkexecbench.cc
浏览文件 @
9bbaf1df
extern
"C"
{
#include "types.h"
#include "stat.h"
#include "user.h"
#include "mtrace.h"
#include "amd64.h"
}
#define NITERS 16
...
...
forkexectree.cc
浏览文件 @
9bbaf1df
extern
"C"
{
#include "types.h"
#include "stat.h"
#include "user.h"
#include "mtrace.h"
}
#define NCHILD 2
#define NDEPTH 7
...
...
forktree.cc
浏览文件 @
9bbaf1df
extern
"C"
{
#include "types.h"
#include "stat.h"
#include "user.h"
#include "mtrace.h"
}
#define NCHILD 2
#define NDEPTH 5
...
...
httpd.cc
浏览文件 @
9bbaf1df
extern
"C"
{
#include "types.h"
#include "user.h"
#include "lib.h"
#include "unet.h"
#include "fcntl.h"
#include "stat.h"
}
#define VERSION "0.1"
#define HTTP_VERSION "1.0"
...
...
init.cc
浏览文件 @
9bbaf1df
// init: The initial user-level program
extern
"C"
{
#include "types.h"
#include "stat.h"
#include "user.h"
#include "fcntl.h"
#include "lib.h"
}
static
const
char
*
sh_argv
[]
=
{
"sh"
,
0
};
static
const
char
*
app_argv
[][
MAXARG
]
=
{
...
...
lockstat.cc
浏览文件 @
9bbaf1df
extern
"C"
{
#include "types.h"
#include "stat.h"
#include "user.h"
#include "fcntl.h"
#include "amd64.h"
#include "lockstat.h"
}
static
void
xwrite
(
int
fd
,
char
c
)
...
...
ls.cc
浏览文件 @
9bbaf1df
extern
"C"
{
#include "types.h"
#include "stat.h"
#include "user.h"
#include "fs.h"
}
const
char
*
fmtname
(
const
char
*
path
)
...
...
mapbench.cc
浏览文件 @
9bbaf1df
extern
"C"
{
#include "types.h"
#include "stat.h"
#include "user.h"
#include "mtrace.h"
#include "amd64.h"
#include "uspinlock.h"
}
static
struct
uspinlock
l
;
static
volatile
int
tcount
;
...
...
maptest.c
→
maptest.c
c
浏览文件 @
9bbaf1df
...
...
@@ -55,7 +55,7 @@ main(void)
}
sbrk
(
4096
);
forkt
(
sbrk
(
0
),
thr
,
0
);
forkt
(
sbrk
(
0
),
(
void
*
)
thr
,
0
);
acquire
(
&
l
);
state
=
1
;
...
...
printf.c
→
printf.c
c
浏览文件 @
9bbaf1df
...
...
@@ -37,7 +37,7 @@ void
vprintfmt
(
void
(
*
putch
)
(
void
*
,
char
),
void
*
putarg
,
const
char
*
fmt
,
va_list
ap
)
{
char
*
s
;
c
onst
c
har
*
s
;
int
c
,
i
,
state
;
state
=
0
;
...
...
@@ -58,7 +58,7 @@ vprintfmt(void (*putch) (void*, char), void *putarg,
state
=
'l'
;
continue
;
}
else
if
(
c
==
's'
){
s
=
(
c
har
*
)
va_arg
(
ap
,
char
*
);
s
=
(
c
onst
char
*
)
va_arg
(
ap
,
const
char
*
);
if
(
s
==
0
)
s
=
"(null)"
;
while
(
*
s
!=
0
){
...
...
@@ -119,7 +119,7 @@ struct bufstate {
static
void
writebuf
(
void
*
arg
,
char
c
)
{
struct
bufstate
*
bs
=
arg
;
struct
bufstate
*
bs
=
(
bufstate
*
)
arg
;
if
(
bs
->
p
<
bs
->
e
)
{
bs
->
p
[
0
]
=
c
;
bs
->
p
++
;
...
...
sh.cc
浏览文件 @
9bbaf1df
// Shell.
extern
"C"
{
#include "types.h"
#include "user.h"
#include "fcntl.h"
}
// Parsed command representation
#define EXEC 1
...
...
sleep.cc
浏览文件 @
9bbaf1df
extern
"C"
{
#include "types.h"
#include "stat.h"
#include "user.h"
#include "fcntl.h"
#include "amd64.h"
}
int
main
(
int
ac
,
char
*
av
[])
...
...
telnetd.cc
浏览文件 @
9bbaf1df
extern
"C"
{
#include "types.h"
#include "user.h"
#include "unet.h"
}
int
main
(
void
)
...
...
thrtest.cc
浏览文件 @
9bbaf1df
extern
"C"
{
#include "types.h"
#include "stat.h"
#include "user.h"
#include "mtrace.h"
#include "amd64.h"
#include "uspinlock.h"
}
static
struct
uspinlock
l
;
static
volatile
int
tcount
;
...
...
time.cc
浏览文件 @
9bbaf1df
extern
"C"
{
#include "types.h"
#include "stat.h"
#include "user.h"
#include "fcntl.h"
#include "amd64.h"
}
int
main
(
int
ac
,
const
char
*
av
[])
...
...
ulib.c
→
ulib.c
c
浏览文件 @
9bbaf1df
...
...
@@ -124,8 +124,8 @@ memmove(void *vdst, const void *vsrc, int n)
const
char
*
src
;
char
*
dst
;
dst
=
vdst
;
src
=
vsrc
;
dst
=
(
char
*
)
vdst
;
src
=
(
const
char
*
)
vsrc
;
while
(
n
--
>
0
)
*
dst
++
=
*
src
++
;
return
vdst
;
...
...
umalloc.c
→
umalloc.c
c
浏览文件 @
9bbaf1df
移动文件
unet.h
浏览文件 @
9bbaf1df
#ifdef LWIP
extern
"C"
{
#include "lwip/sockets.h"
// system calls
...
...
@@ -7,6 +8,7 @@ extern int bind(int sockfd, const struct sockaddr *addr,
socklen_t
addrlen
);
extern
int
listen
(
int
sockfd
,
int
backlog
);
extern
int
accept
(
int
sockfd
,
struct
sockaddr
*
addr
,
socklen_t
*
addrlen
);
}
static
inline
const
char
*
ipaddr
(
struct
sockaddr_in
*
sin
)
...
...
user.h
浏览文件 @
9bbaf1df
struct
stat
;
// system calls
extern
"C"
{
int
fork
(
int
);
int
exit
(
void
)
__attribute__
((
noreturn
));
int
wait
(
void
);
...
...
@@ -25,6 +26,7 @@ int uptime(void);
int
map
(
void
*
addr
,
int
len
);
int
unmap
(
void
*
addr
,
int
len
);
void
halt
(
void
);
}
// ulib.c
int
stat
(
char
*
,
struct
stat
*
);
...
...
@@ -42,7 +44,9 @@ void free(void*);
int
atoi
(
const
char
*
);
// uthread.S
extern
"C"
{
int
forkt
(
void
*
sp
,
void
*
pc
,
void
*
arg
);
}
// printf.c
void
printf
(
int
,
const
char
*
,
...);
...
...
usertests.cc
浏览文件 @
9bbaf1df
extern
"C"
{
#include "types.h"
#include "stat.h"
#include "user.h"
...
...
@@ -6,7 +5,6 @@ extern "C" {
#include "fcntl.h"
#include "syscall.h"
#include "traps.h"
}
char
buf
[
2048
];
char
name
[
3
];
...
...
编写
预览
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论