@@ -17,6 +17,7 @@ app_entry_o = $(BUILD_DIR)/app_entry.o
1717
1818# Apps
1919app_calc = $(BUILD_DIR ) /calc
20+ app_ttt = $(BUILD_DIR ) /ttt
2021app_dashboard = $(BUILD_DIR ) /dashboard
2122
2223# Parameters
@@ -28,21 +29,25 @@ all: images binaries
2829
2930images : $(image_vmdk )
3031
31- binaries : $(bt_stage1 ) $(bt_stage2 ) $( app_calc )
32+ binaries : $(bt_stage1 ) $(bt_stage2 )
3233
33- $(image_vmdk ) : $(bt_stage1 ) $(bt_stage2 ) $(app_calc )
34+ $(image_vmdk ) : $(bt_stage1 ) $(bt_stage2 ) $(app_calc ) $( app_ttt )
3435 dd bs=512 count=2 if=$(bt_stage1 ) of=$@
3536 /bin/echo -ne " \x55\xaa" | dd seek=510 bs=1 of=$@
3637 cat $(bt_stage2 ) >> $@
3738 cat $(app_calc ) >> $@
39+ cat $(app_ttt ) >> $@
3840 @echo " Stage 1 Size : " $$(stat -c %s $(bt_stage1 ) )
3941 @echo " Stage 2 Size : " $$(stat -c %s $(bt_stage2 ) )
4042 @echo " App Calc Size : " $$(stat -c %s $(app_calc ) )
43+ @echo " App TTT Size : " $$(stat -c %s $(app_ttt ) )
4144 @echo " Image Size : " $$(stat -c %s $@ )
4245 @echo " Want BT_STAGE2_SECTOR_COUNT : 0x" $$(printf "%x\n" $$(( $$(stat -c %s $(bt_stage2 ) ) / 512 ) ) )
4346 @echo " Got BT_STAGE2_SECTOR_COUNT : 0x" $(BT_STAGE2_SECTOR_COUNT )
44- @echo " AppSector Sector Count : " $$(( $$(stat -c %s $(app_calc ) ) / 512 ) )
45- @echo " AppSector Sector Start : " $$(( 1 + $$(stat -c %s $(bt_stage1 ) ) / 512 + $$(stat -c %s $(bt_stage2 ) ) / 512 ) )
47+ @echo " AppCalc Sector Count : " $$(( $$(stat -c %s $(app_calc ) ) / 512 ) )
48+ @echo " AppCalc Sector Start : " $$(( 1 + $$(stat -c %s $(bt_stage1 ) ) / 512 + $$(stat -c %s $(bt_stage2 ) ) / 512 ) )
49+ @echo " AppTTT Sector Count : " $$(( $$(stat -c %s $(app_ttt ) ) / 512 ) )
50+ @echo " AppTTT Sector Start : " $$(( 1 + $$(stat -c %s $(bt_stage1 ) ) / 512 + $$(stat -c %s $(bt_stage2 ) ) / 512 + $$(stat -c %s $(app_calc ) ) / 512 ) )
4651
4752$(bt_stage1 ) : $(BL_SRC_DIR ) /stage1.asm $(BL_SRC_DIR ) /constants.asm $(BL_SRC_DIR ) /io.asm $(BL_SRC_DIR ) /disk.asm
4853 nasm -o $@ -f bin -i $(BL_SRC_DIR ) / -D BT_STAGE2_SECTOR_COUNT=$(BT_STAGE2_SECTOR_COUNT ) $<
@@ -66,6 +71,11 @@ $(app_calc): $(app_entry_o) $(APP_DIR)/calc.c $(SYSCALLS_SRC_DIR)/basic.h $(SYSC
6671 ld --oformat binary -m elf_i386 -Ttext 0xC000 --strip-all -o $@ $(app_entry_o ) $(BUILD_DIR ) /calc.o
6772 truncate --size=%512 $@
6873
74+ $(app_ttt ) : $(app_entry_o ) $(APP_DIR ) /tic_tac_toe.c $(SYSCALLS_SRC_DIR ) /basic.h $(SYSCALLS_SRC_DIR ) /io.h $(SYSCALLS_SRC_DIR ) /time.h $(SYSCALLS_SRC_DIR ) /color.h $(UTIL_SRC_DIR ) /string.h $(BL_SRC_DIR ) /constants.asm $(BL_SRC_DIR ) /io.asm $(SYSCALLS_SRC_DIR ) /io_syscall.asm $(SYSCALLS_SRC_DIR ) /time_syscall.asm
75+ gcc -m16 -fno-pie -c -Isrc -o $(BUILD_DIR ) /ttt.o $(APP_DIR ) /tic_tac_toe.c
76+ ld --oformat binary -m elf_i386 -Ttext 0xC000 --strip-all -o $@ $(app_entry_o ) $(BUILD_DIR ) /ttt.o
77+ truncate --size=%512 $@
78+
6979debug_stage1 : $(bt_stage1 )
7080 objdump -b binary -mi386 -Maddr16,data16 -D $<
7181 xxd $<
0 commit comments