File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -240,12 +240,6 @@ apic_boot.o: hw/apic_boot.asm
240240
241241multiboot : boot/multiboot.o
242242
243- # Disk image as a section
244- # ##################################################
245- memdisk : memdisk.asm
246- @echo " \n>> Assembling memdisk"
247- nasm -f elf -o memdisk.o $<
248-
249243# Etags
250244# ##################################################
251245etags :
@@ -261,6 +255,6 @@ clean_tests:
261255clean : clean_tests
262256 $(RM ) $(OS_OBJECTS ) $(CXXABI_OBJ ) $(OS_DEPS ) $(DRIVERS ) $(DRIVERS_DEPS ) $(PLATFORMS ) $(PLATFORMS_DEPS )
263257 $(RM ) os.a libc++abi.a
264- $(RM ) bootloader apic_boot apic_boot.o memdisk.o boot/multiboot.o
258+ $(RM ) bootloader apic_boot apic_boot.o boot/multiboot.o
265259
266260-include $(OS_DEPS )
Original file line number Diff line number Diff line change 2222#include < fs/memdisk.hpp>
2323#include < statman>
2424
25- #define likely (x ) __builtin_expect(!!(x), 1 )
26- #define unlikely (x ) __builtin_expect(!!(x), 0 )
27-
2825extern " C" {
2926 char _DISK_START_;
3027 char _DISK_END_;
@@ -47,7 +44,7 @@ namespace fs {
4744
4845 auto sector_loc = image_start_ + blk * block_size ();
4946 // Disallow reading memory past disk image
50- if (unlikely (sector_loc >= image_end_))
47+ if (UNLIKELY (sector_loc >= image_end_))
5148 return buffer_t {};
5249
5350 auto buffer = new uint8_t [block_size ()];
@@ -64,7 +61,7 @@ namespace fs {
6461 auto end_loc = start_loc + cnt * block_size ();
6562
6663 // Disallow reading memory past disk image
67- if (unlikely (end_loc >= image_end_))
64+ if (UNLIKELY (end_loc >= image_end_))
6865 return buffer_t {};
6966
7067 auto buffer = new uint8_t [cnt * block_size ()];
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -119,20 +119,12 @@ minimal: CPPOPTS += -ffunction-sections -fdata-sections
119119minimal : LDOPTS += --gc-sections
120120minimal : stripped
121121
122- # Disk image as a section
123- # ##################################################
124- memdisk :
125- @echo " \n>> Creating memdisk"
126- python $(INSTALL ) /memdisk/memdisk.py --file $(INSTALL ) /memdisk/memdisk.asm $(DISK )
127- @echo " \n>> Assembling memdisk"
128- nasm -f elf $(INSTALL ) /memdisk/memdisk.asm -o $(MEMDISK )
129-
130122# Service
131123# ##################################################
132124
133125# Link the service with the os
134- service : $(OBJS ) $(LIBS )
135- # build memdisk when IMAGES is set
126+ service : $(OBJS ) $(LIBS ) $( DRIVER_OBJS ) $( PLATFORM_OBJS )
127+ # build memdisk only when MEMDISK is set
136128ifneq ($(MEMDISK ) ,)
137129 @echo "\n>> Creating memdisk"
138130 python $(INSTALL)/memdisk/memdisk.py --file $(INSTALL)/memdisk/memdisk.asm $(DISK)
@@ -174,7 +166,7 @@ crt%.o: $(INSTALL)/crt/crt%.s
174166# Cleanup
175167# ##################################################
176168clean :
177- $(RM ) $(OBJS ) $(DEPS ) $( SERVICE )
178- $(RM ) $(SERVICE ) .img $(MEMDISK )
169+ $(RM ) $(OBJS ) $(DEPS )
170+ $(RM ) $(SERVICE ) $( SERVICE ) .img $(MEMDISK )
179171
180172-include $(DEPS )
You can’t perform that action at this time.
0 commit comments