2020-09-17 09:52:56 +02:00
|
|
|
##### Variables
|
|
|
|
GODEBUG=exec gnome-terminal --geometry=120x55+1+1 -x ./debug/debug.sh
|
2019-01-12 20:46:00 +01:00
|
|
|
REMOVE=rm -f
|
|
|
|
INSTALL=sudo apt-get install
|
|
|
|
COPY=cp
|
|
|
|
GIT=git status
|
|
|
|
MAKECALL=python makesyscall.py
|
2020-09-17 09:52:56 +02:00
|
|
|
MAKE=make -C
|
|
|
|
SYNC=sync
|
|
|
|
KILL=killall
|
2020-09-18 22:06:25 +02:00
|
|
|
TAR=tar cf - . | gzip -f - > ./backup.tar.gz
|
|
|
|
HEXDUMPDSK=hexdump -C ./final/harddisk.img.final|head -c10000
|
|
|
|
HEXDUMPSYS=hexdump -C ./system/system.sys
|
2020-09-17 09:52:56 +02:00
|
|
|
TMUXKILL=tmux kill-session -t
|
|
|
|
TRUE=|| true
|
|
|
|
SPICE=spicy --uri=spice://127.0.0.1?port=5900
|
|
|
|
SOURCE=xxd -i
|
|
|
|
EMUX86=qemu-system-i386
|
|
|
|
EMUX64=qemu-system-x86_64
|
|
|
|
LEGACY=-m 1G -drive format=raw,file=./final/harddisk.img.final --enable-kvm -cpu host -s -vga qxl -spice port=5900,addr=127.0.0.1,disable-ticketing
|
|
|
|
UEFI=-m 5G -drive format=raw,file=./final/harddiskuefi.img.final --bios /usr/share/qemu/OVMF.fd --enable-kvm -cpu host -s -vga qxl -spice port=5900,addr=127.0.0.1,disable-ticketing
|
|
|
|
DEBUG=-S -monitor telnet:127.0.0.1:6666,server,nowait
|
|
|
|
WAIT2S=sleep 2
|
|
|
|
|
|
|
|
##### Construction
|
|
|
|
|
2020-09-18 22:06:25 +02:00
|
|
|
all: tools programs system harddisk harddiskuefi
|
2020-09-17 09:52:56 +02:00
|
|
|
$(SYNC)
|
|
|
|
|
2020-09-18 22:06:25 +02:00
|
|
|
system: lib/libs.o system/system.sys
|
2020-09-17 09:52:56 +02:00
|
|
|
$(SYNC)
|
2007-04-02 14:52:01 +02:00
|
|
|
|
2018-12-27 14:24:47 +01:00
|
|
|
tools: tools/build
|
|
|
|
|
|
|
|
tools/build:
|
2020-09-17 09:52:56 +02:00
|
|
|
$(MAKE) tools
|
2018-12-27 14:24:47 +01:00
|
|
|
|
2018-12-16 01:50:03 +01:00
|
|
|
syscall: clean remakeapi all
|
|
|
|
|
|
|
|
remakeapi:
|
2019-01-12 20:46:00 +01:00
|
|
|
$(MAKECALL)
|
2018-12-16 01:50:03 +01:00
|
|
|
|
2020-09-17 09:52:56 +02:00
|
|
|
programs:
|
|
|
|
$(MAKE) programs
|
2018-12-09 13:44:32 +01:00
|
|
|
|
2018-09-27 07:55:24 +02:00
|
|
|
harddisk: final/harddisk.img.final
|
|
|
|
|
2020-09-17 09:52:56 +02:00
|
|
|
harddiskuefi: final/harddiskuefi.img.final
|
2018-09-27 11:13:27 +02:00
|
|
|
|
2020-09-17 16:37:16 +02:00
|
|
|
system/system.sys:
|
|
|
|
$(MAKE) system
|
|
|
|
|
|
|
|
final/harddisk.img.final:
|
|
|
|
$(MAKE) final harddisk.img.final
|
|
|
|
|
|
|
|
final/harddiskuefi.img.final:
|
|
|
|
$(MAKE) final harddiskuefi.img.final
|
|
|
|
|
|
|
|
lib/libs.o:
|
|
|
|
$(MAKE) lib
|
|
|
|
|
|
|
|
##### Divers
|
2018-07-24 04:04:07 +02:00
|
|
|
|
2018-12-12 12:31:30 +01:00
|
|
|
togit:
|
2020-09-17 09:52:56 +02:00
|
|
|
$(MAKE) system togit
|
|
|
|
$(MAKE) lib togit
|
|
|
|
$(MAKE) final togit
|
|
|
|
$(MAKE) programs togit
|
|
|
|
$(MAKE) tools togit
|
2019-01-12 20:46:00 +01:00
|
|
|
$(GIT)
|
2020-09-17 09:52:56 +02:00
|
|
|
$(SYNC)
|
2018-12-12 12:31:30 +01:00
|
|
|
|
2007-04-02 14:52:01 +02:00
|
|
|
clean:
|
2020-09-19 22:32:13 +02:00
|
|
|
$(REMOVE) ./configuration
|
2020-09-17 16:37:16 +02:00
|
|
|
$(REMOVE) ./syscalls.txt
|
2020-09-17 09:52:56 +02:00
|
|
|
$(REMOVE) .gdb_history
|
|
|
|
$(MAKE) system clean
|
|
|
|
$(MAKE) lib clean
|
|
|
|
$(MAKE) final clean
|
|
|
|
$(MAKE) programs clean
|
|
|
|
$(MAKE) tools clean
|
|
|
|
$(SYNC)
|
2007-04-02 14:52:01 +02:00
|
|
|
|
2018-09-27 07:55:24 +02:00
|
|
|
littleclean:
|
2020-09-17 09:52:56 +02:00
|
|
|
$(MAKE) system clean
|
|
|
|
$(MAKE) lib clean
|
|
|
|
$(MAKE) final littleclean
|
|
|
|
$(MAKE) programs clean
|
|
|
|
$(SYNC)
|
2018-09-27 07:55:24 +02:00
|
|
|
|
2018-09-27 17:12:12 +02:00
|
|
|
indent:
|
2020-09-17 09:52:56 +02:00
|
|
|
$(MAKE) system indent
|
|
|
|
$(MAKE) lib indent
|
|
|
|
$(MAKE) programs indent
|
|
|
|
$(MAKE) tools indent
|
|
|
|
$(SYNC)
|
2018-09-27 17:12:12 +02:00
|
|
|
|
2007-04-02 14:52:01 +02:00
|
|
|
backup: clean
|
2020-09-17 09:52:56 +02:00
|
|
|
$(TAR)
|
|
|
|
|
2020-09-18 22:06:25 +02:00
|
|
|
view-dsk:
|
|
|
|
$(HEXDUMPDSK)
|
|
|
|
|
|
|
|
view-sys:
|
|
|
|
$(HEXDUMPSYS)
|
2020-09-17 16:37:16 +02:00
|
|
|
|
|
|
|
##### Alias
|
|
|
|
|
2020-09-17 09:52:56 +02:00
|
|
|
test: test32
|
2018-09-27 07:55:24 +02:00
|
|
|
|
2020-09-17 09:52:56 +02:00
|
|
|
retest: retest32
|
2018-07-24 04:04:07 +02:00
|
|
|
|
2020-09-18 22:06:25 +02:00
|
|
|
test32: all qemu32
|
2018-09-27 11:13:27 +02:00
|
|
|
|
2020-09-18 22:06:25 +02:00
|
|
|
test64: all qemu64
|
2020-09-17 09:52:56 +02:00
|
|
|
|
|
|
|
retest32: littleclean test32
|
2018-07-24 04:04:07 +02:00
|
|
|
|
2018-09-27 17:12:12 +02:00
|
|
|
retest64: littleclean test64
|
2018-09-27 11:13:27 +02:00
|
|
|
|
2020-09-17 09:52:56 +02:00
|
|
|
##### Debuguage
|
2018-07-24 04:04:07 +02:00
|
|
|
|
2020-09-17 09:52:56 +02:00
|
|
|
debug: debug-system32
|
2018-08-22 18:39:06 +02:00
|
|
|
|
2020-09-17 09:52:56 +02:00
|
|
|
redebug32: littleclean debug-system32
|
2018-10-02 17:16:23 +02:00
|
|
|
|
2018-09-27 11:13:27 +02:00
|
|
|
debug64: debug-system64
|
|
|
|
|
2018-10-13 17:17:40 +02:00
|
|
|
redebug64: littleclean debug-system64
|
|
|
|
|
2019-01-11 14:25:48 +01:00
|
|
|
kernel: debug-kernel
|
|
|
|
|
2020-09-18 22:06:25 +02:00
|
|
|
debug-boot32: all qemu-debug32
|
2020-09-17 09:52:56 +02:00
|
|
|
$(WAIT2S)
|
|
|
|
$(GODEBUG) ./debug/boot.txt
|
2018-07-24 04:04:07 +02:00
|
|
|
|
2020-09-18 22:06:25 +02:00
|
|
|
debug-boot64: all qemu-debug64
|
2020-09-17 09:52:56 +02:00
|
|
|
$(WAIT2S)
|
2020-09-18 22:06:25 +02:00
|
|
|
$(GODEBUG) ./debug/boot.txt
|
2018-07-24 04:04:07 +02:00
|
|
|
|
2020-09-18 22:06:25 +02:00
|
|
|
debug-system32: all qemu-debug32
|
2020-09-17 09:52:56 +02:00
|
|
|
$(WAIT2S)
|
|
|
|
$(GODEBUG) ./debug/system.txt
|
2018-09-27 11:13:27 +02:00
|
|
|
|
2020-09-18 22:06:25 +02:00
|
|
|
debug-system64: all qemu-debug64
|
|
|
|
$(WAIT2S)
|
|
|
|
$(GODEBUG) ./debug/system.txt
|
2020-09-17 09:52:56 +02:00
|
|
|
|
|
|
|
##### Emulation
|
2019-01-11 14:25:48 +01:00
|
|
|
|
2020-09-17 09:52:56 +02:00
|
|
|
qemu-debug32: killer
|
|
|
|
$(EMUX86) $(LEGACY) $(DEBUG) &
|
|
|
|
$(SPICE) &
|
2018-07-24 04:04:07 +02:00
|
|
|
|
2019-01-12 20:46:00 +01:00
|
|
|
qemu-debug64: killer
|
2020-09-17 09:52:56 +02:00
|
|
|
$(EMUX64) $(UEFI) $(DEBUG) &
|
|
|
|
$(SPICE) &
|
2018-09-27 11:13:27 +02:00
|
|
|
|
2020-09-17 09:52:56 +02:00
|
|
|
qemu32: killer
|
|
|
|
$(EMUX86) $(LEGACY) &
|
|
|
|
$(WAIT2S)
|
|
|
|
$(SPICE)
|
2018-09-27 07:55:24 +02:00
|
|
|
|
2019-01-12 20:46:00 +01:00
|
|
|
qemu64: killer
|
2020-09-17 09:52:56 +02:00
|
|
|
$(EMUX64) $(UEFI) &
|
|
|
|
$(WAIT2S)
|
|
|
|
$(SPICE)
|
2020-09-18 22:06:25 +02:00
|
|
|
|
2020-09-19 20:30:49 +02:00
|
|
|
##### Configuration
|
|
|
|
|
|
|
|
config:
|
|
|
|
@echo "*** Options de compilation"
|
|
|
|
@echo "Quelle distribution utiliser avec Docker comme environnement de compilation ?"
|
|
|
|
@echo "Alpine Linux ou Debian [A*/D]"
|
|
|
|
@read line; if [ $$line = "D" ]; then sed -i -r 's/compilation=.*/compilation=debian/' configuration ; else sed -i -r 's/compilation=.*/compilation=alpine/' configuration ; fi
|
|
|
|
@echo "Quel mode vidéo préférez vous utiliser ?"
|
|
|
|
@echo "VESA ou VGA [E*/G]"
|
|
|
|
@read line; if [ $$line = "G" ]; then sed -i -r 's/video=.*/video=vga/' configuration ; else sed -i -r 's/video=.*/video=vesa/' configuration ; fi
|
2020-09-19 22:32:13 +02:00
|
|
|
|