diff options
| author | Jake Mannens <jake72360@gmail.com> | 2018-06-24 01:49:05 +1000 |
|---|---|---|
| committer | Jake Mannens <jake72360@gmail.com> | 2018-06-24 01:49:05 +1000 |
| commit | acba87c1e946118f0ba4308a7211199cf9b7cbb2 (patch) | |
| tree | 034276cdb5a855516317069b37075a768b46ce96 /kernel/usrbin/link.ld | |
| parent | 2c429f6e1ac51ea27f203005eeef20d2b05c759e (diff) | |
Modified makefiles to use the more appropriate variable $(MAKE) when
invoking the tool recursively.
Disabled GCC's position-independent-code generation in makefiles.
Modified makefile for kernel/usrbin so that it now compiles and links C
code into the userspace test.
Created errno.h and populated it with standard error definitions.
Replaced the va_list based system call handlers with a system call table
defined in the header kernel/sys.h. NOTE: This header is included in
kmain.c and should ONLY be included there! Do NOT include this header in
sys.c.
Rather than fetching the user's stack pointer and using it to initialize
a va_list, parameters are now passed to the call handlers via the
general purpose registers EAX, EBX, ECX and EDX where EAX contains the
requested call number and conveys the return value.
Setup macros in unistd.h to aid to making system calls from userspace.
Implemented two basic system calls; sys_print and sys_dummy. The former
takes a single char* argument and displays it on screen whilst the
latter is used to populate otherwise empty entries of the system call
table. sys_dummy returns the error ENOSYS whenever it is called.
Diffstat (limited to 'kernel/usrbin/link.ld')
| -rw-r--r-- | kernel/usrbin/link.ld | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/kernel/usrbin/link.ld b/kernel/usrbin/link.ld new file mode 100644 index 0000000..c1a7a42 --- /dev/null +++ b/kernel/usrbin/link.ld @@ -0,0 +1,8 @@ +OUTPUT_FORMAT(binary) +SECTIONS +{ + . = 0x100000; + .text : { *(.entry); .*(.text) } + .data : { *(.data) } + .bss : { *(.bss) } +} |
