@@ -44,15 +44,15 @@ app_dashboard = $(BUILD_APP)/dashboard
44
44
# Parameters
45
45
# 1-byte hex and 1-based indexing for BT STAGE 2 ONLY
46
46
SECTOR_START_BT_STAGE2 = 03
47
- SECTOR_COUNT_BT_STAGE2 = 19
47
+ SECTOR_COUNT_BT_STAGE2 = 0b
48
48
SECTOR_START_SHARED_LIBRARY = 1
49
49
SECTOR_COUNT_SHARED_LIBRARY = 1
50
- SECTOR_START_KERNEL = 27
51
- SECTOR_COUNT_KERNEL = 33
52
- SECTOR_START_APP_TTT = 60
53
- SECTOR_COUNT_APP_TTT = 25
54
- SECTOR_START_APP_CALC = 85
55
- SECTOR_COUNT_APP_CALC = 25
50
+ SECTOR_START_KERNEL = 13
51
+ SECTOR_COUNT_KERNEL = 34
52
+ SECTOR_START_APP_TTT = 47
53
+ SECTOR_COUNT_APP_TTT = 18
54
+ SECTOR_START_APP_CALC = 65
55
+ SECTOR_COUNT_APP_CALC = 18
56
56
57
57
MEMORY_STATIC_LIBRARY = 0x7E00
58
58
MEMORY_LOCATION_KERNEL = 0xC000
@@ -64,7 +64,8 @@ SOURCE_SNAPSHOT="\"$$(git rev-parse --short HEAD)$$(git diff --quiet || echo '_u
64
64
# # Integer is 4 bytes
65
65
66
66
# Tools
67
- CC =gcc -std=c++11 -Os
67
+ CC =gcc -std=c++11 -Os -nostartfiles -nostdlib -static
68
+ LD =ld -nostdlib -nostartfiles -nodefaultlibs --print-map --strip-all
68
69
69
70
# Targets
70
71
rebuild : clean all_artifacts
@@ -170,7 +171,7 @@ $(bt_stage2): $(SRC_BOOTLOADER)/stage2.asm $(SRC_BOOTLOADER)/stage2.c $(SRC_MEMM
170
171
-D MEMORY_LOCATION_KERNEL=$(MEMORY_LOCATION_KERNEL ) \
171
172
-D MEMORY_LOCATION_APP=$(MEMORY_LOCATION_APP ) \
172
173
-o $(BUILD_BOOTLOADER ) /stage2_c.o $(SRC_BOOTLOADER ) /stage2.c
173
- ld --oformat binary -m elf_i386 -Ttext 0x8000 --strip-all -o $@ $(BUILD_BOOTLOADER ) /stage2_asm.o $(BUILD_BOOTLOADER ) /stage2_c.o $(BUILD_LIB_UTILS ) /libutils_16 $(BUILD_DRIVERS ) /display/libtm_bios $(BUILD_DRIVERS ) /disk/libdisk_16
174
+ $( LD ) --oformat binary -m elf_i386 -Ttext 0x8000 -T linker.ld -o $@ $(BUILD_BOOTLOADER ) /stage2_asm.o $(BUILD_BOOTLOADER ) /stage2_c.o $(BUILD_LIB_UTILS ) /libutils_16 $(BUILD_DRIVERS ) /display/libtm_bios $(BUILD_DRIVERS ) /disk/libdisk_16
174
175
truncate --size=%512 $@
175
176
176
177
$(BUILD_REALMODE ) /static_library : $(SRC_REALMODE ) /static_library.asm $(SRC_REALMODE ) /stub.asm
@@ -191,7 +192,7 @@ $(kernel_core): $(SRC_KERNEL)/core.asm $(SRC_KERNEL)/core.c $(SRC_KERNEL)/essent
191
192
-D SECTOR_START_APP_CALC=$(SECTOR_START_APP_CALC ) \
192
193
-D SECTOR_COUNT_APP_CALC=$(SECTOR_COUNT_APP_CALC ) \
193
194
-o $(BUILD_KERNEL ) /core_c.o $(SRC_KERNEL ) /core.c
194
- ld --oformat binary -m elf_i386 --trace - Ttext 0x0000 --strip-all -o $(kernel_core ) $(BUILD_KERNEL ) /core_asm.o $(BUILD_KERNEL ) /process_asm.o $(BUILD_KERNEL ) /core_c.o $(BUILD_KERNEL ) /interrupts_asm.o $(BUILD_DRIVERS ) /keyboard/libkeyboard $(BUILD_LIB_UTILS ) /libutils $(BUILD_DRIVERS ) /display/libtm_vga $(BUILD_LIB_DS ) /libds $(BUILD_DRIVERS ) /disk/libdisk $(BUILD_LIB_SYSCALL ) /libsyscall
195
+ $( LD ) --oformat binary -m elf_i386 -Ttext 0x0000 -T linker.ld -o $(kernel_core ) $(BUILD_KERNEL ) /core_asm.o $(BUILD_KERNEL ) /process_asm.o $(BUILD_KERNEL ) /core_c.o $(BUILD_KERNEL ) /interrupts_asm.o $(BUILD_DRIVERS ) /keyboard/libkeyboard $(BUILD_LIB_UTILS ) /libutils $(BUILD_DRIVERS ) /display/libtm_vga $(BUILD_LIB_DS ) /libds $(BUILD_DRIVERS ) /disk/libdisk $(BUILD_LIB_SYSCALL ) /libsyscall
195
196
truncate --size=%512 $(kernel_core )
196
197
197
198
# Libraries
@@ -274,11 +275,11 @@ $(BUILD_LIB_SYSCALL)/libsyscall: $(SRC_LIB_SYSCALL)/syscall.h $(SRC_LIB_SYSCALL)
274
275
$(app_calc ) : $(app_entry ) $(SRC_APP ) /calc.c $(SRC_LIB_UTILS ) /output.h $(SRC_LIB_UTILS ) /time.h $(BUILD_LIB_UTILS ) /libutils $(BUILD_DRIVERS ) /display/libtm_vga $(BUILD_LIB_SYSCALL ) /libsyscall # And dependecies :/
275
276
mkdir -p $$(dirname $(app_calc ) )
276
277
$(CC ) -m32 -fno-pie -c -Isrc -o $(BUILD_APP ) /calc.o $(SRC_APP ) /calc.c
277
- ld --oformat binary -m elf_i386 -Ttext 0x0 --strip-all -o $@ $(app_entry ) $(BUILD_APP ) /calc.o $(BUILD_LIB_UTILS ) /libutils $(BUILD_DRIVERS ) /display/libtm_vga $(BUILD_LIB_SYSCALL ) /libsyscall
278
+ $( LD ) --oformat binary -m elf_i386 -Ttext 0x0 -T linker.ld -o $@ $(app_entry ) $(BUILD_APP ) /calc.o $(BUILD_LIB_UTILS ) /libutils $(BUILD_DRIVERS ) /display/libtm_vga $(BUILD_LIB_SYSCALL ) /libsyscall
278
279
truncate --size=%512 $@
279
280
280
281
$(app_tic_tac_toe ) : $(app_entry ) $(SRC_APP ) /tic_tac_toe.c $(SRC_LIB_UTILS ) /output.h $(SRC_LIB_UTILS ) /input.h $(SRC_LIB_UTILS ) /time.h $(BUILD_LIB_UTILS ) /libutils $(BUILD_DRIVERS ) /display/libtm_vga $(BUILD_LIB_SYSCALL ) /libsyscall # And dependecies :/
281
282
mkdir -p $$(dirname $(app_tic_tac_toe ) )
282
283
$(CC ) -m32 -fno-pie -c -Isrc -o $(BUILD_APP ) /tic_tac_toe.o $(SRC_APP ) /tic_tac_toe.c
283
- ld --oformat binary -m elf_i386 -Ttext 0x0 --strip-all -o $@ $(app_entry ) $(BUILD_APP ) /tic_tac_toe.o $(BUILD_LIB_UTILS ) /libutils $(BUILD_DRIVERS ) /display/libtm_vga $(BUILD_LIB_SYSCALL ) /libsyscall
284
+ $( LD ) --oformat binary -m elf_i386 -Ttext 0x0 -T linker.ld -o $@ $(app_entry ) $(BUILD_APP ) /tic_tac_toe.o $(BUILD_LIB_UTILS ) /libutils $(BUILD_DRIVERS ) /display/libtm_vga $(BUILD_LIB_SYSCALL ) /libsyscall
284
285
truncate --size=%512 $@
0 commit comments