Skip to content

Commit af993c3

Browse files
committed
Merge branch 'master' into stage8
2 parents 783c1fa + 0d55519 commit af993c3

23 files changed

+408
-263
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -20,29 +20,9 @@ jobs:
2020
strategy:
2121
matrix:
2222
os: [ubuntu-latest,macos-latest,windows-latest]
23-
rust: [nightly]
24-
include:
25-
- os: macOS-latest
26-
rust: 'nightly'
27-
components: 'rustfmt, clippy, rust-src'
28-
targets: 'x86_64-apple-darwin'
29-
- os: windows-latest
30-
rust: 'nightly'
31-
components: 'rustfmt, clippy, rust-src'
32-
targets: 'x86_64-pc-windows-msvc'
33-
- os: ubuntu-latest
34-
rust: 'nightly'
35-
components: 'rustfmt, clippy, rust-src'
36-
targets: 'x86_64-unknown-linux-musl'
37-
3823

3924
steps:
40-
- uses: hecrj/[email protected]
41-
with:
42-
rust-version: ${{ matrix.rust }}
43-
components: ${{ matrix.components || '' }}
44-
targets: ${{ matrix.targets || '' }}
45-
- uses: actions/checkout@v1
25+
- uses: actions/checkout@v2
4626
with:
4727
submodules: true
4828
- name: Check Cargo availability

.github/workflows/format.yml

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -18,29 +18,9 @@ jobs:
1818
strategy:
1919
matrix:
2020
os: [ubuntu-latest]
21-
rust: [nightly]
22-
include:
23-
- os: macOS-latest
24-
rust: 'nightly'
25-
components: 'rustfmt, clippy'
26-
targets: 'x86_64-apple-darwin'
27-
- os: windows-latest
28-
rust: 'nightly'
29-
components: 'rustfmt, clippy'
30-
targets: 'x86_64-pc-windows-msvc'
31-
- os: ubuntu-latest
32-
rust: 'nightly'
33-
components: 'rustfmt, clippy'
34-
targets: 'x86_64-unknown-linux-musl'
35-
3621

3722
steps:
38-
- uses: hecrj/[email protected]
39-
with:
40-
rust-version: ${{ matrix.rust }}
41-
components: ${{ matrix.components || '' }}
42-
targets: ${{ matrix.targets || '' }}
43-
- uses: actions/checkout@v1
23+
- uses: actions/checkout@v2
4424
with:
4525
submodules: true
4626
- name: Check Cargo availability

.gitlab-ci.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
stages:
2+
- prepare
3+
- build
4+
- test
5+
6+
variables:
7+
DOCKER_FILE: Dockerfile
8+
DOCKER_TAG: latest
9+
DOCKER_IMAGE: ${CI_REGISTRY_IMAGE}
10+
GIT_SUBMODULE_STRATEGY: normal
11+
FF_GITLAB_REGISTRY_HELPER_IMAGE: 1
12+
13+
.prepare:docker: &prepare_docker
14+
stage: prepare
15+
image:
16+
name: quay.io/buildah/stable
17+
variables:
18+
_BUILDAH_STARTED_IN_USERNS: ""
19+
BUILDAH_ISOLATION: chroot
20+
BUILDAH_LAYERS: "true"
21+
before_script:
22+
- buildah version
23+
- buildah login --username "${CI_REGISTRY_USER}" --password "${CI_REGISTRY_PASSWORD}" "${CI_REGISTRY}"
24+
script:
25+
- buildah bud -f ${DOCKER_FILE} -t ${DOCKER_IMAGE}:${DOCKER_TAG} .
26+
- buildah push ${DOCKER_IMAGE}:${DOCKER_TAG} docker://${DOCKER_IMAGE}:${DOCKER_TAG}
27+
after_script:
28+
- buildah logout "${CI_REGISTRY}"
29+
tags:
30+
- builder
31+
32+
prepare:docker:
33+
<<: *prepare_docker
34+
35+
build:kernel:
36+
stage: build
37+
image: ${CI_REGISTRY_IMAGE}
38+
script:
39+
- cargo build -Z build-std=core,alloc --no-default-features --target x86_64-eduos.json
40+
artifacts:
41+
paths:
42+
- target/x86_64-eduos/debug/eduos-rs
43+
44+
test:kernel:
45+
stage: test
46+
dependencies:
47+
- build:kernel
48+
image: ${CI_REGISTRY_IMAGE}
49+
script:
50+
- lscpu
51+
- kvm-ok
52+
- RUST_LOG=debug ehyve -f ./demo/hello target/x86_64-eduos/debug/eduos-rs
53+
tags:
54+
- privileged

.travis.yml

Lines changed: 0 additions & 39 deletions
This file was deleted.

Cargo.lock

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Dockerfile

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
1-
# Download base image ubuntu 18.04
2-
FROM ubuntu:18.04
1+
FROM ubuntu:latest
32

43
ENV DEBIAN_FRONTEND=noninteractive
54

6-
# Update Software repository
7-
RUN apt-get -qq update
8-
9-
# Install required packets from ubuntu repository
10-
RUN apt-get install -y apt-transport-https curl wget vim nano git binutils autoconf automake make cmake qemu-kvm qemu-system-x86 nasm gcc g++ build-essential libtool bsdmainutils lld-8
5+
RUN apt-get update && \
6+
apt-get -y install cpu-checker util-linux apt-transport-https curl wget binutils build-essential gcc libtool bsdmainutils pkg-config libssl-dev git qemu-kvm qemu-system-x86 nasm seabios qemu-utils fdisk grub-pc grub-pc-bin grub-imageboot grub-legacy-ec2 multiboot kpartx gzip && \
7+
apt-get clean
118

129
# Install Rust toolchain
13-
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain nightly
10+
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain nightly --profile minimal
1411
RUN /root/.cargo/bin/rustup component add rust-src
1512
RUN /root/.cargo/bin/rustup component add llvm-tools-preview
1613
RUN /root/.cargo/bin/cargo install --git https://github.com/RWTH-OS/ehyve.git
1714

1815
ENV PATH="/root/.cargo/bin:/root/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/bin/:${PATH}"
1916
ENV EDITOR=vim
17+
18+
# Switch back to dialog for any ad-hoc use of apt-get
19+
ENV DEBIAN_FRONTEND=dialog
20+

README.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
[![Build Status](https://travis-ci.com/RWTH-OS/eduOS-rs.svg?branch=master)](https://travis-ci.com/RWTH-OS/eduOS-rs)
2-
![Actions Status](https://github.com/RWTH-OS/eduOS-rs/workflows/Build/badge.svg)
3-
41
# eduOS-rs - A teaching operating system written in Rust
52

63
## Introduction

rust-toolchain.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[toolchain]
2-
channel = "nightly-2021-02-11"
2+
channel = "nightly-2021-10-20"
33
components = [
44
"clippy",
55
"rustfmt",

src/arch/mod.rs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,6 @@ pub use self::x86_64::kernel::{
1515
#[cfg(target_arch = "x86_64")]
1616
pub use self::x86_64::load_application;
1717

18-
// Export our platform-specific modules.
19-
#[cfg(target_arch = "x86_64")]
20-
pub use self::x86_64::kernel::switch::switch;
21-
2218
// Export our platform-specific modules.
2319
#[cfg(target_arch = "x86_64")]
2420
pub use self::x86_64::mm;
@@ -32,3 +28,13 @@ pub use self::x86_64::mm::paging::{
3228
// Implementations for x86_64.
3329
#[cfg(target_arch = "x86_64")]
3430
pub mod x86_64;
31+
32+
extern "C" {
33+
pub fn __switch(old_stack: *mut usize, new_stack: usize);
34+
}
35+
36+
pub fn switch(old_stack: *mut usize, new_stack: usize) {
37+
unsafe {
38+
__switch(old_stack, new_stack);
39+
}
40+
}

src/arch/x86_64/kernel/irq.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,19 @@ const KERNEL_CODE_SELECTOR: SegmentSelector = SegmentSelector::new(1, Ring::Ring
2424

2525
/// Enable Interrupts
2626
pub fn irq_enable() {
27-
unsafe { llvm_asm!("sti" ::: "memory" : "volatile") };
27+
unsafe { asm!("sti", options(nomem, nostack)) };
2828
}
2929

3030
/// Disable Interrupts
3131
pub fn irq_disable() {
32-
unsafe { llvm_asm!("cli" ::: "memory" : "volatile") };
32+
unsafe { asm!("cli", options(nomem, nostack)) };
3333
}
3434

3535
/// Determines, if the interrupt flags (IF) is set
3636
pub fn is_irq_enabled() -> bool {
3737
let rflags: u64;
3838

39-
unsafe { llvm_asm!("pushf; pop $0": "=r"(rflags) :: "memory" : "volatile") };
39+
unsafe { asm!("pushf; pop {}", lateout(reg) rflags, options(nomem, nostack, preserves_flags)) };
4040
if (rflags & (1u64 << 9)) != 0 {
4141
return true;
4242
}

0 commit comments

Comments
 (0)