Skip to content

Commit

Permalink
Merge pull request arceos-org#46 from LyonRust/main
Browse files Browse the repository at this point in the history
docs: macOS run StarryOS
  • Loading branch information
Azure-stars authored May 4, 2024
2 parents ff27196 + cfe8a5c commit 3fabb80
Show file tree
Hide file tree
Showing 9 changed files with 103 additions and 0 deletions.
99 changes: 99 additions & 0 deletions README-macOS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
# `macOS` 开发 `StarryOS` 环境部署说明

这是一个介绍如何在`macOS`系统下部署 `StarryOS` 开发环境的说明文档。此文档默认构建`x86_64`架构的`fat`磁盘镜像

## 提交人员

[李扬(技安)](https://github.com/LyonRust/Starry)

## 操作步骤

以下所有的操作步骤都是在当前项目根目录中操作.

1. 安装 `rust`

```shell
$ xcode-select --install
$ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
```

2. 安装 `qemu`

```shell
$ brew install qemu
```

3. 安装 `cargo-binutils`

```shell
$ cargo install cargo-binutils
$ rustup component add llvm-tools
```

4. 创建磁盘文件

```shell
$ dd if=/dev/zero of=disk.img bs=4M count=30
```

5. 给磁盘文件添加文件系统

```shell
$ open disk.img
```

这个时候会弹出一个是否初始化的弹窗, 点击初始化,会打开磁盘管理器

![初始化](./doc/macOS/001.jpg)

6. 格式化磁盘

![002](./doc/macOS/002.png)
6-1 选中磁盘, 点击格式化

![003](./doc/macOS/003.png)
6-2 格式化选项选择 `MS-DOS [FAT]`格式

![004](./doc/macOS/004.png)
6-3 点击格式化按钮

![005](./doc/macOS/005.png)
6-4 格式化完成

![006](./doc/macOS/006.png)
6-5 弹出磁盘

7. 后续的磁盘操作

```shell
# 创建文件夹
$ mkdir -p mnt

# 挂载磁盘
$ hdiutil attach disk.img -mountpoint mnt

# 拷贝文件
$ cp -r ./testcases/$FILE/* ./mnt/

# 卸载磁盘
$ hdiutil detach mnt

# 改变文件权限
$ chmod 777 disk.img
```

8. 运行`StarryOS`

```shell
# 运行宏内核
$ make run

# 运行 shell
$ make A=apps/fs/shell AARCH=x86_64 FEATURES=fp_simd run
```

## 运行效果

`macOS`系统下运行`StarryOS`效果

![007](./doc/macOS/007.png)
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ make A=apps/monolithic_userboot ARCH=riscv64 APP_FEATURES=batch run

```

### `macOS`下原生运行`StarryOS`

[点击查看详细说明文档](./README-macOS.md)

## CI 说明
本项目的 CI 结构继承了 arceos 的 CI 结构,同时在其上加入了宏内核的测试用例,以求保证该项目可以在宏内核和 Unikernel 架构以及不同的指令集架构下正常运行。

Expand Down
Binary file added doc/macOS/001.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/macOS/002.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/macOS/003.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/macOS/004.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/macOS/005.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/macOS/006.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/macOS/007.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 3fabb80

Please sign in to comment.