Open william1357chen opened 6 months ago
Found several issues while updating the Makefile.
initcode.S
. Do some reading on how to handle linker symbols if our new path for initcode
is user/initcode.S
ulib.o
, usys.o
UPROGS
are required to be on the root directory since there's a check in mkfs.c
to throw runtime error#include fcntl.h
TODOs:
$(LD) $(LDFLAGS) -T kernel.ld -o kernel entry.o $(OBJS) -b binary initcode entryother
The linker is going to embed the binary and automatically create some symbols so we can reference it in code.
See post: https://stackoverflow.com/questions/29034840/binutils-kernel-binary-meaning
Action item: test out what symbol is created with objcopy
or ld
when objfile is in a directory. If we cannot use the symbols, find another workaround.
Potential workaround: https://stackoverflow.com/questions/327609/include-binary-file-with-gnu-ld-linker-script
Update: was able to move user space assembly to user/
and updated symbols
Helpful posts: https://stupefydeveloper.blogspot.com/2008/08/cc-embed-binary-data-into-elf.html
Description