Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop #1

Closed
wants to merge 144 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
144 commits
Select commit Hold shift + click to select a range
34ae222
Initial commit
rennergade May 21, 2021
bed1018
first commit
May 21, 2021
7891032
folder structure
May 21, 2021
f49f657
folder structure
May 21, 2021
cb799ce
folder structure
May 21, 2021
9362248
initial interface attempts - full of bugs
Jun 2, 2021
0e03b83
file interface rough
Jun 2, 2021
92afcc1
Misc and timer improvements and fixes, not working yet though
jesings Jun 2, 2021
fb401ce
Missed timer main changes
jesings Jun 2, 2021
6511dad
timer changes
Jun 3, 2021
c2bfa2d
misc changes
Jun 3, 2021
b312b8c
file changes
Jun 3, 2021
9b114de
file changes
Jun 3, 2021
d113f69
caging/dispatcher start + reorg
Jun 4, 2021
ffaea7c
caging/dispatcher start + reorg
Jun 4, 2021
9f8f760
errnos
Jun 4, 2021
30a7660
Made changes so that the interface compiles (#8)
jesings Jun 8, 2021
6182b27
imports/enum print
Jun 8, 2021
fcffd8e
filesystem
Jun 9, 2021
deda5ad
filesystem
Jun 9, 2021
8757ae6
filesystem
Jun 9, 2021
4fc986a
filesystem
Jun 9, 2021
a890017
cage impl
Jun 10, 2021
4b138da
cage impl
Jun 10, 2021
0b092ca
cage impl
Jun 10, 2021
392d98f
diagram
Jun 14, 2021
c1ecc98
Kind of finalizing the state of the interface before I attempt to add…
jesings Jun 10, 2021
b11fba1
Added some example syscalls!
jesings Jun 11, 2021
49d3552
Added final example syscalls
jesings Jun 14, 2021
d5fee39
Update dispatcher.rs
TristanB22 Jun 14, 2021
b6ac4b0
Update dispatcher.rs
TristanB22 Jun 14, 2021
b262805
Sys calls add calls 1 (#13)
TristanB22 Jun 17, 2021
f402555
serial, openfile (#16)
rennergade Jun 23, 2021
dee42c2
Many fscall additions, some architectural additions (i.e. metawalk) (…
jesings Jun 24, 2021
98410a2
Implemented read and write system calls (#18)
jesings Jun 25, 2021
05eb628
Extricated fileobjecttable (#19)
jesings Jun 25, 2021
7184b6e
Added mknod, link, unlink (#20)
jesings Jun 26, 2021
edb967e
Made tests not disgusting, added special file creator and mkdir (#22)
jesings Jun 28, 2021
50e4d36
Persistmetadata (#26)
rennergade Jun 30, 2021
78eae75
Mmap implementation (#25)
jesings Jun 30, 2021
c1db453
Implemented linkcount for cwd in chdir/exit/fork to prevent corruptin…
jesings Jul 1, 2021
f68fcd2
Init/finalize and a slew of fixes to go along with them (#29)
jesings Jul 1, 2021
00541b4
Some code cleanup, one fix in fork (#35)
jesings Jul 12, 2021
6d7dcbe
adding close / fcntl / dup / dup2 / chmod (#32)
TristanB22 Jul 13, 2021
a7e143e
Flock implemented (#34)
jesings Jul 13, 2021
95890be
Adding tests -- simple, chmod, chdir, dup, dup2 (#37)
TristanB22 Jul 14, 2021
a7e5826
fcntl cleanup, close implementations (#38)
jesings Jul 14, 2021
2818d3a
Adding mode, multiple, flags, link, unlink, lseek, complex tests. Als…
TristanB22 Jul 16, 2021
456fc9a
Added rmdir() and rename() (#33)
kliu513 Jul 23, 2021
1c564e6
minmax (#48)
rennergade Jul 26, 2021
b6a9ab2
Merged PR's for tests and (f)statfs (#45)
TristanB22 Jul 27, 2021
82c0758
Added epoll fds (#50)
jesings Jul 28, 2021
9dae5d1
Dispatcher changes2 (#49)
TristanB22 Aug 2, 2021
83e270d
length check for logptr (#55)
rennergade Aug 3, 2021
13ec8e8
trunc func (#57)
rennergade Aug 4, 2021
21f6f18
Dispatcher changes3 (#58)
TristanB22 Aug 6, 2021
bc0a2f2
Add truncate() and ftruncate() (#56)
kliu513 Aug 9, 2021
02b7afd
Add pipes() (#59)
rennergade Aug 11, 2021
df5bab7
Add getdents() (#47)
kliu513 Aug 13, 2021
9c463eb
Added fs utils script (WIP) (#39)
jesings Aug 17, 2021
7fbb474
Getdents test fixes, sync removal, persist fixes, mangling removal (#68)
jesings Aug 23, 2021
b367a31
Fixed bugs to work with rust RPC (#77)
jesings Sep 29, 2021
35531d7
Flush stdout on print (#78)
rennergade Oct 14, 2021
0f04a61
add stream to dup helper (#80)
rennergade Oct 16, 2021
3bc3a34
Deep copy fds (#83)
rennergade Oct 26, 2021
15385be
Updated exit() syscall (#81)
youngfalcon Oct 26, 2021
d47b947
Keep advisory lock on duplicate instead of creating new one (#85)
rennergade Nov 2, 2021
f723ad1
Test-1
kapkic Nov 13, 2021
a080b36
Update types.rs
kapkic Nov 19, 2021
ceb1e06
Update fs_calls.rs
kapkic Nov 19, 2021
f1a146c
Update fs_calls.rs
kapkic Nov 19, 2021
f4b8532
Forkexec calls (#87)
kapkic Dec 10, 2021
38e67d6
Consolidate pipe len reads (#88)
rennergade Dec 22, 2021
c3d664e
Force-testing proc-macro2 dependency.
kapkic Dec 24, 2021
25db28f
Stat fix (#89)
rennergade Dec 29, 2021
83c92a0
Getcwd (#91)
youngfalcon Jan 5, 2022
ce94bff
Ci cd rustposix, adds GithubActions functionality (#96)
kapkic Jan 14, 2022
2ffc573
Bringing lind into the 21st century with networking! (#100)
jesings Jan 26, 2022
a25dab8
Get[e][u-g]id fix (#99)
kapkic Jan 27, 2022
2db0906
Link RustPOSIX verbosity to Lind (#101)
rennergade Jan 27, 2022
f3e7e99
Fixed net constants! (#103)
jesings Jan 30, 2022
aefbf44
(Partially) Implemented Ioctl (#102)
youngfalcon Feb 1, 2022
e947e1d
Socketpair less awful (#104)
jesings Feb 2, 2022
310ba4d
Fixed all cargo warnings (#105)
jesings Feb 7, 2022
e103f37
Fixed poll struct type (#107)
jesings Feb 10, 2022
008c01a
Fixed fs_tests (#108)
jesings Feb 15, 2022
0a2cdcb
Optimize Metadata (#109)
rennergade Feb 17, 2022
4d894d7
Added a test case that makes a DNS query! (#110)
jesings Feb 17, 2022
25ed730
Fixed recvfrom for udp (#111)
jesings Feb 17, 2022
7e47629
Udp fix (#112)
jesings Feb 21, 2022
a45debb
Fixed all the necessary things for gethostbyname/flask (#113)
jesings Feb 23, 2022
9e85dd6
Fix deadlock in listen (#114)
rennergade Feb 25, 2022
aad86f2
Correct /dev/ permissions (#115)
rennergade Feb 25, 2022
bc22de3
Cloexec supported! (#116)
jesings Mar 1, 2022
38db321
Implemented pipe2 (#117)
jesings Mar 1, 2022
217cea6
CLOEXEC fixes (companion PR) (#120)
rennergade Mar 12, 2022
8dece60
Added skipping draft PR feature. (#122)
kapkic Mar 18, 2022
74529ba
Pipeclose reffix (#124)
rennergade Mar 18, 2022
13226fd
Blocking fixes (#125)
rennergade Mar 29, 2022
6cf047b
Finished dashmap implementation (#126)
jesings Apr 26, 2022
80a1e04
Tests fix (#131)
jesings May 4, 2022
9a31cc4
SHM (#130)
rennergade May 10, 2022
27ee88e
stubs (#132)
rennergade May 13, 2022
221f446
O_NONBLOCK and O_TRUNC fixes (#134)
rennergade May 19, 2022
7be1121
Networking fix for localports and socket connections (#135)
jesings May 29, 2022
d4604c9
UNIX Domain Sockets (#136)
rennergade Jun 21, 2022
4349124
Getifaddrs (#137)
rennergade Jun 22, 2022
9c43cf3
changes to lazy/once cell for 1.63+ (#138)
rennergade Jun 30, 2022
7381ecf
Create pull_request_template.md (#180)
RusherRG Jul 8, 2023
aee8b75
port license file from main lind repo
rennergade Nov 9, 2023
ede57e6
Develop (#210)
rennergade Feb 27, 2024
73fb9c1
Develop Main Merge 2 (#212)
rennergade Mar 28, 2024
741d181
main hotfixes (#213)
rennergade Mar 29, 2024
febdbce
fixed: included devcontainer (#214)
naveensrinivasan Apr 23, 2024
929874a
fixes for running lind install (#219)
yashaswi2000 Apr 24, 2024
34715c6
Add temporary instructions
Yaxuan-w Apr 22, 2024
cc9ff21
Modify RustPOSIX link
Yaxuan-w Apr 22, 2024
5b96cf1
Open/Close Performance/Style Fixes (#225)
rennergade May 5, 2024
cafe945
fixed: included devcontainer (#214)
naveensrinivasan Apr 23, 2024
4a00d23
fixes for running lind install (#219)
yashaswi2000 Apr 24, 2024
5eadeed
Readme update (#221)
yashaswi2000 May 2, 2024
cd7d0ec
first cut at benchmarking with Criterion. Will expand the set of ben…
JustinCappos May 5, 2024
7a410bb
Removing toy benchmark, adding comparison with native system call tim…
JustinCappos May 7, 2024
27a12ac
Accept timeout loop (#229)
rennergade May 7, 2024
f4e8df3
Create rust.yml
rennergade May 7, 2024
4e45806
make select faster by yielding instead of sleeping, properly check si…
rennergade May 8, 2024
fcae485
update rust ci
rennergade May 8, 2024
de9a9ae
update rust ci
rennergade May 8, 2024
b351c61
update rust ci (#236)
rennergade May 8, 2024
af9cea5
included tests setup and basic test
naveensrinivasan May 9, 2024
9ce2230
removed the formatting based on code review
naveensrinivasan May 9, 2024
7419bf6
parameterized r/w
JustinCappos May 8, 2024
ecef654
parameterization for the lseek + read + write benchmark
JustinCappos May 8, 2024
53306fc
Fixing type casting
Yaxuan-w May 8, 2024
868cb06
Fixing type casting: conditional compile
Yaxuan-w May 8, 2024
688e0ee
Fixing type casting: conditional compile
Yaxuan-w May 8, 2024
55b6b40
Fixing type casting: conditional compile
Yaxuan-w May 8, 2024
536ffa8
Fixed
Yaxuan-w May 8, 2024
a1d8e6c
clarifing octal and fixing NONBLOCK bug (#239)
JustinCappos May 10, 2024
a20737a
rustfmt :- format the code. (#240)
naveensrinivasan May 10, 2024
631917d
removing unneeded files
JustinCappos May 15, 2024
d9f8104
Example grates
JustinCappos May 15, 2024
b77785b
more fdtable work
JustinCappos May 17, 2024
6b20558
fdtable draft
JustinCappos May 17, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Use an official Rust image as a parent image
FROM ubuntu:latest
ARG DEBIAN_FRONTEND=noninteractive
ARG arch=x86_64

# Install tools and dependencies for building Rust projects
RUN apt-get update && apt-get install -y \
build-essential \
pkg-config \
curl \
libssl-dev \
git
# Install Rust from source
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y
# Add cargo bin to PATH
ENV PATH="/root/.cargo/bin:${PATH}"

# Install the nightly Rust toolchain
RUN rustup toolchain install nightly

# Set the default toolchain to nightly
RUN rustup default nightly

# Verify installation
RUN rustc --version

20 changes: 20 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"name": "Rust (Unstable)",
"build": {
"dockerfile": "Dockerfile"
},
"customizations": {
"vscode": {
"settings": {
"terminal.integrated.shell.linux": "/bin/bash"
},
"extensions": [
"rust-lang.rust"
]
}
},
"forwardPorts": [],
"postCreateCommand": "cargo check",
"remoteUser": "root"
}

35 changes: 35 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
## Description

Fixes # (issue)

<!-- Please include a summary of the changes and the related issue. -->
<!-- Please also include relevant motivation and context. Why is this change required? What problem does it solve? -->
<!-- List any dependencies that are required for this change. -->

### Type of change

<!-- Please delete options that are not relevant. -->

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] This change requires a documentation update

## How Has This Been Tested?

<!-- Please describe the tests that you ran to verify your changes. -->
<!-- Provide instructions so we can reproduce. -->
<!-- Please also list any relevant details for your test configuration -->

- Test A - `lind_project/tests/test_cases/test_a.c`
- Test B - `lind_project/tests/test_cases/test_b.c`

## Checklist:

<!-- Add details about the checklist whenever needed -->

- [ ] My code follows the style guidelines of this project
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] Any dependent changes have been added to a pull request and/or merged in other modules (native-client, lind-glibc, lind-project)
63 changes: 63 additions & 0 deletions .github/workflows/lind-selfhost.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: RustPOSIX Build

# Controls when the workflow will run
on:
push:
branches:
- develop
- main
pull_request:
branches:
- develop
- main
# Triggers the workflow on push or pull request events but only for the develop branch
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
build:
runs-on: self-hosted
if: github.event.pull_request.draft == false
steps:
- name: Echo out branch values
run: |
echo github.base_ref: ${{ github.base_ref }}
echo github.head_ref: ${{ github.head_ref }}
echo github.ref: ${{ github.ref }}
cd /home/lind/lind_project/

- name: Checkout lind-project
run: |
git --git-dir /home/lind/lind_project/.git remote update origin --prune;
git --git-dir /home/lind/lind_project/.git checkout --force remotes/origin/develop;

- name: In the land of RUSTPOSIX where the shadows lie (PR request)
if: github.head_ref != ''
run: |
git --git-dir /home/lind/lind_project/src/safeposix-rust/.git remote update origin --prune;
git --git-dir /home/lind/lind_project/src/safeposix-rust/.git checkout remotes/origin/${{ github.head_ref }};
make rustposix;

- name: In the land of RUSTPOSIX where the shadows lie (Develop/Push)
if: github.head_ref == ''
run: |
git --git-dir /home/lind/lind_project/src/safeposix-rust/.git remote update origin --prune;
git --git-dir /home/lind/lind_project/src/safeposix-rust/.git checkout remotes/origin/develop;
make rustposix;

- name: One NACL to rule them all
run: |
git --git-dir /home/lind/lind_project/src/native_client/.git remote update origin --prune;
git --git-dir /home/lind/lind_project/src/native_client/.git checkout remotes/origin/develop;
make nacl;
- name: One GLIBC to find them
run: |
git --git-dir /home/lind/lind_project/src/lind_glibc/.git remote update origin --prune;
git --git-dir /home/lind/lind_project/src/lind_glibc/.git checkout remotes/origin/develop;
make glibc;
- name: One ring to INSTALL them all
run: |
make install;
- name: And in darkness TEST them
run: |
make test-verbose;
26 changes: 26 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Rust

on:
push:
branches: [ "develop" ]
pull_request:
branches: [ "develop" ]

env:
CARGO_TERM_COLOR: always

jobs:

build_and_test:
name: Rust project - latest
runs-on: ubuntu-latest
strategy:
matrix:
toolchain:
- nightly
steps:
- uses: actions/checkout@v4
- run: ./gen_netdevs.sh
- run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }}
- run: cargo build --verbose
- run: cargo test --lib --verbose
13 changes: 12 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,15 @@ Cargo.lock
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
#.idea/

# Added by cargo

/target

**/net_devices

linddata*
gen_netdevs
lind.metadata
lind.md.log
5 changes: 5 additions & 0 deletions .rustfmt.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
ignore = [
"src/safeposix/syscalls/net_constants.rs",
"src/safeposix/syscalls/sys_constants.rs",
"src/safeposix/syscalls/fs_constants.rs",
]
58 changes: 58 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
[package]
name = "rustposix"
version = "0.1.0"
authors = ["Nicholas Smith Renner <[email protected]>", "Jonathan Eli Singer <[email protected]>", "Tristan J. Brigham <[email protected]>"]
edition = "2018"

[lib]
path = "src/lib.rs"
# cdylib is a dynamically linkable library, which is great for linking into
# C programs and similar. rlib is needed for the criterion benchmarking libary
# and creates one of Rust's static libraries. We are currently not generating
# dylib files which are Rust's internal (non-stable) ABI.
# Source: https://users.rust-lang.org/t/what-is-the-difference-between-dylib-and-cdylib/28847/3
crate-type = ["cdylib","rlib"]
test = true

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
serde = { version = "1.0", features = ["derive", "rc"] }
serde_cbor = "0.10"
libc = "0.2"
ringbuf = "0.2.6"
dashmap = { version = "5.1", features=["serde"] }
parking_lot = "0.12"

[dev-dependencies]
criterion = { version = "0.3", features = ["html_reports"]}
tempfile = "3.2.0"
grcov="0.8.19" # code coverage

[[bin]]
name = "lind_fs_utils"
path = "src/tools/fs_utils.rs"

# many benchmarks follow. Don't put any non-benchmarks below this...
[[bench]]
name = "gen_getid"
path = "benches/gen_getid.rs"
harness= false

[[bench]]
name = "fs_open_close"
path = "benches/fs_open_close.rs"
harness= false

[[bench]]
name = "fs_read_write"
path = "benches/fs_read_write.rs"
harness= false

[[bench]]
name = "fs_read_write_seek"
path = "benches/fs_read_write_seek.rs"
harness= false


# Don't put any thing below this... benchmarks above!
Loading
Loading