aboutsummaryrefslogtreecommitdiff
path: root/usr/src
Commit message (Collapse)AuthorAgeFilesLines
* usr: Simplify init.SMiquel Sabaté Solà2024-11-251-4/+1
| | | | | | | | | There appears to be no reasonable way to call 'wfi' from user space and making kernel space look the other way. Moreover, it also looks like clearing TW is not working either. Hence, we will have to implement 'idle' entirely from kernel space and be reasonable about it. Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
* Simplify scheduling by introducing an init processMiquel Sabaté Solà2024-11-241-0/+8
| | | | | | | | | | | | | | | | Scheduling is easier if there is an init process which does nothing. This way we don't have to perform hacks in order to idle in S privilege mode while touching special registers in weird ways. For now this process is kind of costly since 'wfi' is not accepted in this context, but this can be further tuned down in the future by setting TW=1 on 'mstatus', or by handling the exception and allowing it if it comes from the proper process. All of that being said, there is still work to be done as things fail when optimitzations are on. Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
* Enable exception handling from user modeMiquel Sabaté Solà2024-11-223-0/+3
| | | | | | | | This allows us to actually catch system calls and start to run user space programs. That being said, the whole thing is still pretty brittle, and the scheduler is not quite there yet. Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
* usr: Rename foo/bar to fizz/buzzMiquel Sabaté Solà2024-11-223-9/+9
| | | | | | | | | | | | When creating the user space binaries I forgot about their proper names, which is funny on its own. Anyways, let's get them the name they were intended. Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com> alksjdlkajd Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
* Add basic parsing for underlying ELF executablesMiquel Sabaté Solà2024-11-223-6/+6
| | | | | | | | | | | | | The given initrd is a CPIO archive of multiple ELF executables. We are already able to parse the CPIO archive to detect where each file is located, this commit adds the mapping for each ELF executable to the corresponding task_struct. Note that this is still heavily under construction, since we cannot simply jump into the entry point of an executable as we have not yet setup the proper layout from performing context switches. Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
* Initial parsing of the provided initrd fileMiquel Sabaté Solà2024-11-212-0/+26
| | | | | | | | | | | | We expect a CPIO archive with the 'newc' format for the initrd. Parse this archive from the given initrd address and fetch the address for each ELF executable while also pairing which task correspond to which ELF. This commit leaves to do the actual parsing of the ELF file for each task, while also leaving some string utilities to be refined. Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
* usr: Bootstrap the initramfs for the kernelMiquel Sabaté Solà2024-11-181-0/+13
Introduce a sample `foo` program which already calls the `write_and_block` system call which is yet to be implemented by this kernel. Moreover, the same CPIO format is used for the initramfs as with Linux, so we can pass it with QEMU without worries. Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>