Skip to content

Commit e708f23

Browse files
committed
とりまubuntu14.04 x64でmakeできるようにした
1 parent 8f3135c commit e708f23

File tree

4 files changed

+8
-6
lines changed

4 files changed

+8
-6
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ clean:
1919
rm -f *~ *.o *.bin *.dat *.img *.map
2020

2121
run: fd.img
22-
qemu -fda $<
22+
qemu-system-i386 -fda $<
2323

2424
FORCE:
2525
.PHONY: clean FORCE

apps/Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ KERNEL_PATH = ../kernel
22
CFLAGS = -Wall -Wextra
33
CFLAGS += -nostdinc -nostdlib -fno-builtin -c
44
CFLAGS += -Iinclude -I$(KERNEL_PATH)/include
5+
CFLAGS += -m32
56

67
.c.o:
78
gcc $(CFLAGS) -o $@ $<
@@ -11,11 +12,11 @@ apps.img: bin/shell bin/uptime
1112

1213
bin/shell: shell.o
1314
[ -d bin ] || mkdir bin
14-
ld -o $@ $< -Map shell.map -s -T app.ld -x
15+
ld -m elf_i386 -o $@ $< -Map shell.map -s -T app.ld -x
1516

1617
bin/uptime: uptime.o
1718
[ -d bin ] || mkdir bin
18-
ld -o $@ $< -Map uptime.map -s -T app.ld -x
19+
ld -m elf_i386 -o $@ $< -Map uptime.map -s -T app.ld -x
1920

2021
shell.o: shell.c
2122

boot/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
.s.o:
2-
as -o $@ $<
2+
as --32 -o $@ $<
33

44
boot.bin: boot.o
5-
ld -o $@ $< -T boot.ld -Map boot.map
5+
ld -m elf_i386 -o $@ $< -T boot.ld -Map boot.map
66

77
boot.o: boot.s
88

kernel/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
CFLAGS = -Wall -Wextra
22
CFLAGS += -nostdinc -nostdlib -fno-builtin -c
33
CFLAGS += -Iinclude
4+
CFLAGS += -m32
45

56
.S.o:
67
gcc $(CFLAGS) -o $@ $<
78
.c.o:
89
gcc $(CFLAGS) -o $@ $<
910

1011
kernel.bin: sys.o cpu.o intr.o excp.o memory.o sched.o fs.o task.o syscall.o lock.o timer.o console_io.o queue.o common.o debug.o init.o kern_task_init.o
11-
ld -o $@ $+ -Map System.map -s -T sys.ld -x
12+
ld -m elf_i386 -o $@ $+ -Map System.map -s -T sys.ld -x
1213

1314
sys.o: sys.S
1415
cpu.o: cpu.c

0 commit comments

Comments
 (0)