-
Notifications
You must be signed in to change notification settings - Fork 152
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b8ee265
commit 6cd3806
Showing
12 changed files
with
122 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# 版本 1.0.0 | ||
|
||
哈哈!版本 1.0.0 发布!!!,发布 `onix_1.0.0.iso` 文件; | ||
|
||
![](../others/images/snapshot.png) | ||
|
||
## uname 系统调用 | ||
|
||
用于获取简单的系统信息; | ||
|
||
## 配置方式 | ||
|
||
## qemu | ||
|
||
需要提前配置 `tap0` 设备,用于网络; | ||
|
||
```sh | ||
qemu-system-i386 -m 32M -audiodev pa,id=snd -machine pcspk-audiodev=snd -device sb16,audiodev=snd -rtc base=localtime -chardev stdio,mux=on,id=com1 -serial chardev:com1 -netdev tap,id=eth0,ifname=tap0,script=no,downscript=no -device e1000,netdev=eth0 -drive file=onix_1.0.0.iso,media=cdrom,if=ide -boot d | ||
``` | ||
|
||
## vmware | ||
|
||
修改虚拟机 `.vmx` 文件,添加如下内容,另外可能需要添加一个串口设备: | ||
|
||
```sh | ||
# 声霸卡 | ||
sound.present = "TRUE" | ||
sound.virtualDev = "sb16" | ||
sound.opl3.enabled = "TRUE" | ||
sound.autodetect = "TRUE" | ||
sound.baseAddr = "0x220" | ||
sound.dma16 = "5" | ||
sound.dma8 = "1" | ||
sound.irq = "5" | ||
|
||
# e1000 网卡 | ||
ethernet0.virtualDev = "e1000" | ||
``` |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#include <onix/types.h> | ||
#include <onix/stdio.h> | ||
#include <onix/syscall.h> | ||
#include <onix/uname.h> | ||
#include <onix/string.h> | ||
|
||
int main(int argc, char const *argv[], char const *envp[]) | ||
{ | ||
utsname_t name; | ||
int ret = uname(&name); | ||
if (ret < 0) | ||
{ | ||
printf(strerror(ret)); | ||
return ret; | ||
} | ||
printf("%s_%s\n", name.sysname, name.version); | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,8 @@ | |
// 内核魔数,用于校验错误 | ||
#define ONIX_MAGIC 0x20220205 | ||
|
||
#ifndef ONIX_VERSION | ||
#define ONIX_VERSION "1.0.0" | ||
#endif | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#ifndef ONIX_UNAME_H | ||
#define ONIX_UNAME_H | ||
|
||
#include <onix/types.h> | ||
|
||
typedef struct utsname_t | ||
{ | ||
char sysname[9]; // 本版本操作系统的名称 | ||
char nodename[9]; // 与实现相关的网络中节点名称 | ||
char release[9]; // 本实现的当前发行级别 | ||
char version[9]; // 本次发行的版本级别 | ||
char machine[9]; // 系统运行的硬件类型名称 | ||
} utsname_t; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#include <onix/uname.h> | ||
#include <onix/memory.h> | ||
#include <onix/task.h> | ||
#include <onix/string.h> | ||
#include <onix/debug.h> | ||
#include <onix/errno.h> | ||
|
||
#define LOGK(fmt, args...) DEBUGK(fmt, ##args) | ||
|
||
int sys_uname(utsname_t *buf) | ||
{ | ||
if (!memory_access(buf, sizeof(utsname_t), true, running_task()->uid)) | ||
return -EINVAL; | ||
|
||
strncpy(buf->sysname, "onix", 9); | ||
strncpy(buf->nodename, "onix", 9); | ||
strncpy(buf->release, "release", 9); | ||
strncpy(buf->version, ONIX_VERSION, 9); | ||
strncpy(buf->machine, "machine", 9); | ||
return EOK; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters