MBR en assembleur

Fichier assembleur source:

loop:
	jmp loop
times 510-($-$$) db 0
dw 0xaa55

Fichier Makefile:

target=loopkernel.bin
all: $(target)
$(target): loopkernel.S
	nasm -o $@ -f bin $^
clean:
	rm -f  $(target)
run: $(target)
	qemu-system-x86_64 -drive format=raw,file=$(target)

# No graphics (qui: CTRL-A X)
# qemu-system-x86_64 -curses -drive format=raw,file=$(target)

Fichier Makefile (version Docker):

target=loopkernel.bin
all: $(target)
$(target): loopkernel.S
	docker build -t loopkernel .
	docker run -v `pwd`:/mnt loopkernel nasm -o /mnt/$(target) -f bin /mnt/loopkernel.S
clean:
	rm -f $(target)
run: $(target)
	qemu-system-x86_64 -drive format=raw,file=$(target)

Dockerfile:

FROM debian
LABEL author="gas@mines.paris"
RUN apt-get update 
RUN apt-get install -y nasm
#CMD ["ls", "-al", "/mnt"]