Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add initial process, thread and scheduler #46

Open
wants to merge 21 commits into
base: master
Choose a base branch
from
Open

Conversation

dsluijk
Copy link
Collaborator

@dsluijk dsluijk commented Mar 9, 2020

Add a basis for a scheduler.
While it is not done, it does give a good basis for further work.
Suggestions for that work:

  • Add read-only executable memory into user space, where the kernel can execute code in "user mode"
  • Make a simple userspace "libc" library, which is a wrapper around raw syscalls (printf, malloc, etc)
  • Add the possibility of dynamically linked libraries. The currently ELF loader only works with statically linked libraries.
  • Make a working scheduler, with priorities.

@NULLx76 NULLx76 changed the base branch from refactor to master March 11, 2020 13:43
@NULLx76
Copy link
Collaborator

NULLx76 commented Mar 11, 2020

Closes #15, #6

This was linked to issues Mar 11, 2020
@dsluijk dsluijk self-assigned this Mar 14, 2020
@dsluijk dsluijk marked this pull request as ready for review April 8, 2020 23:55
Copy link
Collaborator

@NULLx76 NULLx76 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see a lot of unrelated changes in things like the chipset, why are those here?

kernel/Makefile Outdated
@@ -4,7 +4,9 @@ include $(CURDIR)/../config.mk

# TODO should we have "-nostdinc"?
# Flags to give to the c compiler
CFLAGS += -pipe -std=gnu99 -ffreestanding -Wall -Werror -g -O0 -mcpu=arm1176jzf-s -march=armv6zk -mfpu=vfp -fpic
CFLAGS += -pipe -std=gnu99 -ffreestanding \
-Wall -Werror -Wno-error=unused-function -Wno-error=unused-label -Wno-error=unused-parameter -Wno-error=unused-variable -Wno-error=unused-value -Wno-error=unused-local-typedefs \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We shouldn't ignore these errors

push {r0} // CPSR
sub sp, #60

push {r1} // push r0
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

R0 != R1, right?

#define COURSE_OS_ELF_FILES_H

unsigned int swi_len;
unsigned char swi[34532];
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where does this magic number come from

void handle_syscall(size_t syscallnr, size_t param1, size_t param2, size_t param3, size_t param4) {
INFO("Handling syscall %i", syscallnr);

// switch (syscallnr) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems heavily incomplete?

#include <thread.h>
#include <process.h>

TEST_CREATE(test_process_smoke, {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test should pass

@NULLx76
Copy link
Collaborator

NULLx76 commented Apr 9, 2020

Could you please elaborate on "not done", what is it that does work right now?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Task Scheduler Process abstraction
4 participants