Skip to content

Commit 2d3348b

Browse files
authored
Merge pull request #831 from fwsGonzo/dev
Remove old unused memdisk stuff in makefiles
2 parents 1962fd1 + 2ada95d commit 2d3348b

4 files changed

Lines changed: 7 additions & 27 deletions

File tree

src/Makefile

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -240,12 +240,6 @@ apic_boot.o: hw/apic_boot.asm
240240

241241
multiboot: 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
###################################################
251245
etags:
@@ -261,6 +255,6 @@ clean_tests:
261255
clean: 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)

src/fs/memdisk.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,6 @@
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-
2825
extern "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()];

src/memdisk.asm

Lines changed: 0 additions & 3 deletions
This file was deleted.

src/seed/Makefile

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -119,20 +119,12 @@ minimal: CPPOPTS += -ffunction-sections -fdata-sections
119119
minimal: LDOPTS += --gc-sections
120120
minimal: 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
136128
ifneq ($(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
###################################################
176168
clean:
177-
$(RM) $(OBJS) $(DEPS) $(SERVICE)
178-
$(RM) $(SERVICE).img $(MEMDISK)
169+
$(RM) $(OBJS) $(DEPS)
170+
$(RM) $(SERVICE) $(SERVICE).img $(MEMDISK)
179171

180172
-include $(DEPS)

0 commit comments

Comments
 (0)