When sync is writing to disk, it reserves whole disk to itself.
This commit makes Shell to read username only once from getpwuid().
We used to get username every time prompt was printed.
Every inode holds a weak pointer to shared file data. This contains
physical addresses of pages for inode file data. Physical addresses
are allocated and read on demand.
When last shared mapping is unmapped. The inodes shared data is freed
and written to the inode.
MemoryBackedRegion now inherits from this and is used for private
anonymous mappigs. This will make shared mappings and file backed
mappings much easier to implement.
We only clone mapped pages that have been marked as writeble.
Read/execute only pages will be exactly as in the file itself and
can be demand paged also :D
All executable files are now read from disk and paged on demand.
This was a big rewrite of the old ELF library but in the end
everything seems much cleaner, since all the old functionality was
not actually needed for execution.
I have to do some measurements, but I feel like memory usage dropped
quite a bit after this change.
Add functions to swap endiannes or convert host to big/little endian
This code should be very compiler friendly and should be optimized to
single bswap instruction on x86.
Userspace programs can call tty_ctrl() to disable/enable tty from
handling input and displaying output.
This API is probably going to change in the future to ioctl calls
but I'm not sure how ioctl is used and what functionality should it
have. I decided to create whole new function and syscall for now.
Next I will expose framebuffer in /dev/fb0 and then I can start work
on graphical environment! :D
I change always manually the serial/graphical. When running cmake
you can define variable QEMU_ACCEL that will be used as accelerator.
Also ninja has the following targets for running qemu
1. qemu: Run graphical qemu environment
2. qemu-nographic: Run qemu without graphical screen. You should
select 'serial only' from grub menu.
3. qemu-debug: Run qemu without accelerator and interrupt
debugger.
We now validate pointers passed by the user, to forbid arbitary
memory read/write. Now the user is only allowed to pass in pointers
in their own mapped memory space (or null).
We now use truncate to create disk image, since it doesn't require
writing zeroes to full disk. I also removed creation of third
partition as this was not currently used.
I could delete the whole FixedWidthAllocator as it was now obsolete.
GeneralAllocator is still used by kmalloc. Kmalloc cannot actually
use it since, GeneralAllocator depends on SpinLock and kmalloc runs
without interrupts.
I have no idea why I had made PATH environment variable parsing
to be part of the kernel. Now the shell does the parsing and
environment syscall is no longer needed.