Skip to content

Commit

Permalink
Add docker file
Browse files Browse the repository at this point in the history
  • Loading branch information
v420v committed Nov 24, 2023
1 parent 628cc90 commit 88c8fa8
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 64,381 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ jobs:
run: v . -enable-globals

- name: Run Tests
run: sh ./test-selfhost.sh
run: ./vas main.s -o main.o && ld -o main main.o && ./main


12 changes: 12 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

FROM --platform=linux/x86_64 thevlang/vlang:debian-dev

RUN apt-get update
RUN apt-get -y install sudo && \
sudo apt-get -y install build-essential && \
sudo apt-get -y install git

VOLUME /root/env
WORKDIR /root/env


7 changes: 2 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@

build:
v . -prod

dev:
v .
v . -o vas

clean:
rm *.o *.out ./vas examples/*.o selfhost/*.o
rm *.o *.out ./vas examples/*.o

51 changes: 15 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,21 @@ _start:
```

[If V is not installed](https://github.com/vlang/v)
```sh
$ docker build ./ -t ibulang


# Linux or MacOS:
$ docker run --rm -it -v "$(pwd)":/root/env ibulang

# Windows (CMD):
$ docker run --rm -it -v "%cd%":/root/env ibulang

# Windows (PowerShell):
$ docker run --rm -it -v "${pwd}:/root/env" ibulang

# To leave the environment, enter `exit`.
```

## Build

Expand All @@ -54,40 +68,5 @@ $ ./a.out
```

## How to do self hosting

```
# build
$ v . -prod
$ cd selfhost
$ ../vas -o v2.o vas.s
$ cc -o v2 v2.o
$ ./v2 -o v3.o vas.s
$ cc -o v3 v3.o
$ ./v3 --version
```
![image1](https://github.com/v420v/vas/assets/106643445/d95f1629-6f57-4ea2-a5d2-dce2cc82955a)

## Screens

### Game of Life

![gameoflife](https://github.com/v420v/vas/assets/106643445/af3e0d89-b796-4fd8-8603-31e926c776ea)

[https://github.com/v420v/vas/blob/main/examples/gol.s](https://github.com/v420v/vas/blob/main/examples/gol.s)

## License
MIT

## Contributing
Welcome!

## References
- https://github.com/DQNEO/goas port of GNU Assembler written in go
- https://github.com/skx/assembler Basic X86-64 assembler, written in golang
- https://web.mit.edu/rhel-doc/3/rhel-as-en-3/
- https://docs.oracle.com/cd/E19683-01/817-4912/6mkdg542u/index.html オブジェクトファイル形式

3 changes: 0 additions & 3 deletions selfhost/.gitignore

This file was deleted.

Loading

0 comments on commit 88c8fa8

Please sign in to comment.