Skip to content

Commit

Permalink
add github action
Browse files Browse the repository at this point in the history
  • Loading branch information
MeouSker77 authored and batkiz committed Feb 11, 2023
1 parent c47a457 commit 4bf1235
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 5 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Nightly Build

on:
schedule:
- cron: '0 16 * * *'
workflow_dispatch:

jobs:
nightly-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: wtfjoke/setup-tectonic@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}

- uses: actions/setup-python@v4
with:
python-version: 3.7

- name: build pdf
run: |
apt-get update && apt-get install -y libfuse2
tectonic -X build
# - name: upload pdf file to release
# uses: svenstaro/upload-release-action@v2
# with:
# repo_token: ${{ secrets.GITHUB_TOKEN }}
# file: src/ProgrammingRust.pdf
# asset_name: ProgrammingRust.pdf
# tag: refs/tags/v0.99
# overwrite: true
33 changes: 33 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Check Build

on:
push:
branches: [main]
paths:
- 'src/*'
- 'img/*'
- 'fonts/*'
- '.github/workflows/check.yml'
pull_request:
branches: [main]
paths:
- 'src/*'
- 'img/*'
- 'fonts/*'
- '.github/workflows/check.yml'
workflow_dispatch:

jobs:
check-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: wtfjoke/setup-tectonic@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: check build
run: |
apt-get update && apt-get install -y libfuse2
tectonic -X build
10 changes: 5 additions & 5 deletions src/ch1.tex
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ \chapter{操作系统接口}
xv6的shell是Unix Bourne Shell的基础部分的一个简单实现。
它的实现可以在行(8550)找到。

\section*{处理器和内存}
\section{处理器和内存}

一个xv6进程由用户空间内存(指令、数据、栈)和内核中私有的每个进程的状态组成。
xv6可以\emph{分时(time-share)}处理:它在一个等待执行的进程的集合中透明地切换可用的CPU。
Expand Down Expand Up @@ -162,7 +162,7 @@ \section*{处理器和内存}

xv6不提供用户的概念、没有保护一个用户的文件不会被另一个用户修改的机制;用Unix术语来说就是,所有xv6进程都以root身份运行。

\section*{I/O和文件描述符}
\section{I/O和文件描述符}

\emph{文件描述符(file descriptor)}是一个小整数,它表示一种由内核管理的对象,这种对象可能被一个进程读取或写入。
一个进程可以通过打开文件、目录、设备,创建管道,复制现有描述符来获得一个文件描述符。
Expand Down Expand Up @@ -270,7 +270,7 @@ \section*{I/O和文件描述符}

文件描述符是一个强大的抽象,因为它们隐藏了它们连接到的东西的细节:一个进程写入到文件描述符1可能会写入到一个文件、也可能写入到一个设备例如控制台,也可能写入到一个管道。

\section*{管道}
\section{管道}
\emph{管道(pipe)}是一个暴露给进程的很小的内核缓冲区,在进程看来它是两个文件描述符,一个用于读,一个用于写。
向管道的一端写入的数据可以从管道的另一端读取出来。
管道提供了一种进程间通信的方式。
Expand Down Expand Up @@ -329,7 +329,7 @@ \section*{管道}
第三,管道运行不同阶段并行执行,而文件的方法需要第一个程序结束之后才能运行第二个。
第四,如果你在实现进程间通信,管道的阻塞读取和写入比文件的非阻塞语言更加高效。

\section*{文件系统}
\section{文件系统}
xv6文件系统提供数据文件,它们是未解析的字节数组;以及目录,包含指向数据文件和其他目录的名称。
目录组成一棵树,从一个称为\emph{根(root)}的特殊目录开始。
一个\emph{路径(path)}例如\texttt{/a/b/c}指向根目录\texttt{/}下的\texttt{a}目录下的\texttt{b}目录下的一个叫\texttt{c}的文件或者目录。
Expand Down Expand Up @@ -407,7 +407,7 @@ \section*{文件系统}
如果\texttt{cd}作为普通的命令运行,那么shell会fork一个子进程,子进程会运行\texttt{cd},然后\texttt{cd}会改变\emph{子进程}的工作目录。
父进程(即shell)的工作目录并不会改变。

\section*{现实世界}
\section{现实世界}
Unix的“标准”文件描述符、管道和操作它们的便捷shell语法的组合是编写通用可重用程序的一大进步。
这个想法引起了“软件工具”的文化,这是Unix强大和流行的根本原因,shell也是第一个所谓的“脚本语言”。
Unix系统调用接口一直持续到现在的系统中,例如BSD、Linux和Mac OS X。
Expand Down

0 comments on commit 4bf1235

Please sign in to comment.