[go: nahoru, domu]

Skip to content

Commit

Permalink
fix for i386-elf-gcc 8.2.0 on macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
wangrunji0408 committed Nov 22, 2018
1 parent fb18c14 commit 2dbfb2d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 8 additions & 2 deletions labcodes_answer/lab8_result/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,12 @@ TARGETS :=

USER_PREFIX := __user_

ifeq ($(shell uname), Linux)
M := M
else
M := m
endif

include tools/function.mk

listf_cc = $(call listf,$(1),$(CTYPE))
Expand Down Expand Up @@ -245,7 +251,7 @@ $(call create_target,ucore.img)
SWAPIMG := $(call totarget,swap.img)

$(SWAPIMG):
$(V)dd if=/dev/zero of=$@ bs=1M count=128
$(V)dd if=/dev/zero of=$@ bs=1$(M) count=128

$(call create_target,swap.img)

Expand All @@ -268,7 +274,7 @@ $(SFSROOT):
$(V)$(MKDIR) $@

$(SFSIMG): $(SFSROOT) $(SFSBINS) | $(call totarget,mksfs)
$(V)dd if=/dev/zero of=$@ bs=1M count=128
$(V)dd if=/dev/zero of=$@ bs=1$(M) count=128
@$(call totarget,mksfs) $@ $(SFSROOT)

$(call create_target,sfs.img)
Expand Down
2 changes: 1 addition & 1 deletion labcodes_answer/lab8_result/kern/init/entry.S
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ __boot_pgdir:
.globl __boot_pgdir
# map va 0 ~ 4M to pa 0 ~ 4M (temporary)
.long REALLOC(__boot_pt1) + (PTE_P | PTE_U | PTE_W)
.space (KERNBASE / PGSIZE / 1024 * 4) - (. - __boot_pgdir) # pad to PDE of KERNBASE
.space (KERNBASE >> PGSHIFT >> 10 << 2) - (. - __boot_pgdir) # pad to PDE of KERNBASE
# map va KERNBASE + (0 ~ 4M) to pa 0 ~ 4M
.long REALLOC(__boot_pt1) + (PTE_P | PTE_U | PTE_W)
.space PGSIZE - (. - __boot_pgdir) # pad to PGSIZE
Expand Down

0 comments on commit 2dbfb2d

Please sign in to comment.