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

fixes 3 - make it work #4

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ The container has NASM, GCC, GDB, Make, Vim, et cetera installed.
Make sure you've got Docker running, then run

```sh
docker-compose build
docker compose build
```

## Development

To load the Debian container's Bash shell run

```sh
docker-compose run nasm-gcc
docker compose run nasm-gcc
```

...and you'll see a command prompt like this
Expand All @@ -41,12 +41,14 @@ for example, run `docker-compose run nasm-gcc` to enter the container shell,
then run

```sh
nasm -felf64 helloworld.asm -o helloworld.o
ld -o helloworld.out helloworld.o
chmod u+x helloworld.out
./helloworld.out
nasm -felf64 helloworld.asm -o helloworld.o
ld -o helloworld.out helloworld.o # link helloworld.out with helloworld.o
chmod u+x helloworld.out # give helloworld.out execute permission
./helloworld.out # run helloworld.out
```

or just `make run`

...and you'll see "hello world!" printed to stdout.

## Disassembly
Expand Down
6 changes: 3 additions & 3 deletions nasm-gcc/Dockerfile
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM debian:jessie

RUN apt-get update -y && apt-get install build-essential gdb nasm vim -y
FROM debian:bookworm

RUN apt-get update -y && apt-get install -y build-essential sudo vim gdb nasm
RUN groupadd -g 999 llp && useradd -r -u 999 -g llp llp
RUN usermod -aG sudo llp

USER llp
10 changes: 10 additions & 0 deletions nasm-gcc/src/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.default: build
.PHONY: build
build:
@nasm -felf64 helloworld.asm -o helloworld.o
@ld -o helloworld.out helloworld.o # link helloworld.out with helloworld.o
@chmod u+x helloworld.out # give helloworld.out execute permission

.PHONY: run
run: build
@./helloworld.out # run helloworld.out
Empty file modified nasm-gcc/src/helloworld.asm
100644 → 100755
Empty file.