lunaix-os.git
3 years agofeat: open(2), close(2), mkdir(2) and readdir(2) syscall
Minep [Wed, 27 Jul 2022 16:01:23 +0000 (17:01 +0100)]
feat: open(2), close(2), mkdir(2) and readdir(2) syscall
feat: file descriptor support
feat: fast interge base 2 logarithm.
fix: incorrect cake piece number calculation in cake allocator
fix: incomplete refactoring in ahci code base
fix: file system mounting.
chores: code refactoring and cleaning

3 years agofeat: twifs - pseudo file system for lunaix kernel state exposure
Minep [Sun, 24 Jul 2022 12:51:16 +0000 (13:51 +0100)]
feat: twifs - pseudo file system for lunaix kernel state exposure
feat: vfs_path_walk now capable to mkdir enroute, and handle malformed path.
feat: mkdir, open and close file.
feat: datetime to unix time conversion.
fix: some design consideration.

3 years agofeat: vfs - path walking and dnode caching.
Minep [Wed, 20 Jul 2022 12:31:57 +0000 (13:31 +0100)]
feat: vfs - path walking and dnode caching.
feat: vfs - file system manager for extensible file system implementation.
feat: simple hash table implementation based on hash list.

3 years agofeat: block device support (mount device and partitions)
Minep [Wed, 20 Jul 2022 12:28:21 +0000 (13:28 +0100)]
feat: block device support (mount device and partitions)

3 years agorefactor: change the disk io api to accept device instead of port struct
Minep [Wed, 20 Jul 2022 12:24:25 +0000 (13:24 +0100)]
refactor: change the disk io api to accept device instead of port struct
refactor: add vzalloc and make vcalloc sounds right.
chore: format code and renaming things

3 years agoMerge branch 'sata-ahci-dev'
Minep [Thu, 7 Jul 2022 17:00:39 +0000 (18:00 +0100)]
Merge branch 'sata-ahci-dev'

3 years agoadd pci-pcie slides and resources
Minep [Thu, 7 Jul 2022 16:59:35 +0000 (17:59 +0100)]
add pci-pcie slides and resources

3 years agorefactor: abstract out the code for prdte creation (by imposing a constrain on buffer...
Minep [Thu, 7 Jul 2022 16:52:37 +0000 (17:52 +0100)]
refactor: abstract out the code for prdte creation (by imposing a constrain on buffer size should not >4MiB)
fix: free the alloced dma memory when we done the io test

3 years agofeat: probe more device info
Minep [Thu, 7 Jul 2022 13:12:53 +0000 (14:12 +0100)]
feat: probe more device info
feat: add port reset support
fix: command is executed as CHS mode instead of LBA
fix: delivery of MSI

3 years agoMerge branch 'master' into sata-ahci-dev
Minep [Wed, 6 Jul 2022 22:34:28 +0000 (23:34 +0100)]
Merge branch 'master' into sata-ahci-dev

3 years agofix: remove the reference to unknown variable
Minep [Wed, 6 Jul 2022 22:34:09 +0000 (23:34 +0100)]
fix: remove the reference to unknown variable

3 years agofeat: sector rwm ops test code
Minep [Wed, 6 Jul 2022 22:28:18 +0000 (23:28 +0100)]
feat: sector rwm ops test code
feat: retry sending of command if failed
feat: hex dump
fix: wrong CDB sizing and ensure big-endian on scsi command.
chore: correct some comments and segregated class name

3 years agofeat: disk read/write support for both ATA and ATAPI device
Minep [Tue, 5 Jul 2022 16:23:10 +0000 (17:23 +0100)]
feat: disk read/write support for both ATA and ATAPI device
feat: vcalloc and vcalloc_dma wrapper
refactor: no need tranverse down partial list when grabing a cake!

3 years agoupdate readme
Minep [Tue, 5 Jul 2022 16:22:14 +0000 (17:22 +0100)]
update readme
add reference material

3 years agoMerge branch 'master' into sata-ahci-dev
Minep [Tue, 5 Jul 2022 16:15:38 +0000 (17:15 +0100)]
Merge branch 'master' into sata-ahci-dev

3 years agofeat: ATAPI device capacity probing
Minep [Mon, 4 Jul 2022 23:11:16 +0000 (00:11 +0100)]
feat: ATAPI device capacity probing
feat: SCSI command set support
refactor: The driver code is very tricky! I have tried my best, however I mess it up :)

3 years agoremove explicit path dependency in makefile
Minep [Mon, 4 Jul 2022 17:45:37 +0000 (18:45 +0100)]
remove explicit path dependency in makefile

3 years agoMerge branch 'master' into sata-ahci-dev
Minep [Mon, 4 Jul 2022 15:02:11 +0000 (16:02 +0100)]
Merge branch 'master' into sata-ahci-dev

3 years agoupdate readme
Minep [Mon, 4 Jul 2022 14:58:59 +0000 (15:58 +0100)]
update readme

3 years agofeat: Ability to send command to ATA device.
Minep [Mon, 4 Jul 2022 12:05:04 +0000 (13:05 +0100)]
feat: Ability to send command to ATA device.
feat: Implementation of IDENTIFY (PACKET) DEVICE command issuing.

3 years agofeat: alignment option of cake allocator for dma buffer
Minep [Sun, 3 Jul 2022 15:29:09 +0000 (16:29 +0100)]
feat: alignment option of cake allocator for dma buffer
fix: ensure a minimium dword alignment
chore: adjust comments, code clean up

3 years agofeat: cake (slab) allocator, for dynamic continuous physical page allocation
Minep [Sun, 3 Jul 2022 12:29:37 +0000 (13:29 +0100)]
feat: cake (slab) allocator, for dynamic continuous physical page allocation

3 years agochore: replacing obsolete SATA Specification Rev 1.0a with more recent Rev 3.2
Minep [Wed, 29 Jun 2022 17:13:15 +0000 (18:13 +0100)]
chore: replacing obsolete SATA Specification Rev 1.0a with more recent Rev 3.2

3 years agochore: edit readme
Minep [Wed, 29 Jun 2022 14:30:59 +0000 (15:30 +0100)]
chore: edit readme
chore: add SATA reference material

3 years agofeat: spec-compliant AHCI HBA initialization
Minep [Wed, 29 Jun 2022 14:07:03 +0000 (15:07 +0100)]
feat: spec-compliant AHCI HBA initialization
feat: detect device presence on hba port
fix: ioremap will disable caching on all mapped page.
refactor: releasing the reclaimable page when unlocking memory

3 years agofeat: AHCI probing
Minep [Tue, 28 Jun 2022 23:15:35 +0000 (00:15 +0100)]
feat: AHCI probing

3 years agofeat: vmm_vmap/ioremap/iounmap to make MMIO more flexible and easy
Minep [Tue, 28 Jun 2022 17:51:27 +0000 (18:51 +0100)]
feat: vmm_vmap/ioremap/iounmap to make MMIO more flexible and easy
fix: flush the screen when fault occurs.
chore: update the memory map accordingly.

3 years agochore: corrections on readme and add disclaimer on copyrighted spec.
Minep [Tue, 28 Jun 2022 12:08:18 +0000 (13:08 +0100)]
chore: corrections on readme and add disclaimer on copyrighted spec.
chore: add PCI material.

3 years agofeat: partial PCIe support (MCFG table parsing)
Minep [Tue, 28 Jun 2022 11:52:50 +0000 (12:52 +0100)]
feat: partial PCIe support (MCFG table parsing)
fix: stack overflow when performing PCI probing in QEMU Q35 machine type
chore: noting some emulator related issues.
chore: update readme.

3 years agofeat: BAR sizing and MSI configuration
Minep [Mon, 27 Jun 2022 22:13:10 +0000 (23:13 +0100)]
feat: BAR sizing and MSI configuration
refactor: Add some useful comments

3 years agofeat: MSI capability detection.
Minep [Mon, 27 Jun 2022 18:09:49 +0000 (19:09 +0100)]
feat: MSI capability detection.
refactor: better interfacing and more compact pci device struct.

3 years agoupdate readme and pci material
Minep [Mon, 27 Jun 2022 15:46:47 +0000 (16:46 +0100)]
update readme and pci material

3 years agofeat: PCI bus probing
Minep [Mon, 27 Jun 2022 14:35:27 +0000 (15:35 +0100)]
feat: PCI bus probing
fix: typo in ESC perfix for ANSI color code.

3 years agoupdate readme
Minep [Mon, 27 Jun 2022 00:32:27 +0000 (01:32 +0100)]
update readme

3 years agofix: race condition and partial state issue on injecting signal context into user...
Minep [Mon, 27 Jun 2022 00:24:40 +0000 (01:24 +0100)]
fix: race condition and partial state issue on injecting signal context into user stack
refactor: reduce the system timer frequency to 1024.
refactor: make the kprintf re-entrance and reduce the buffer size.
improve: better debugging experience with qemu.
improve: more information when debugging with iret.

3 years agofeat: new syscall: sigpending, sigsuspend
Minep [Sun, 26 Jun 2022 19:23:18 +0000 (20:23 +0100)]
feat: new syscall: sigpending, sigsuspend
refactor: a dedicate process for handling console keystorke
refactor: better tracing on god-damned GP issue cause by iret
chore: cleaning and formatting.

3 years agofeat: a simple console that support scrolling.
Minep [Sat, 25 Jun 2022 21:52:08 +0000 (22:52 +0100)]
feat: a simple console that support scrolling.

3 years agoMerge branch 'console-dev'
Minep [Sat, 25 Jun 2022 20:46:23 +0000 (21:46 +0100)]
Merge branch 'console-dev'

3 years agoMerge branch 'master' of github.com:Minep/lunaix-os
Minep [Sat, 25 Jun 2022 15:31:57 +0000 (16:31 +0100)]
Merge branch 'master' of github.com:Minep/lunaix-os

3 years agorefactor: make the demos into dedicated files
Minep [Sat, 25 Jun 2022 15:28:16 +0000 (16:28 +0100)]
refactor: make the demos into dedicated files
fix: issues related to gcc optimization
fix: when kernel access user page that lead to pfault, it must not give up without checking the user space address.
chore: formatting

3 years agofeat: experimental tty console with scrollback buffer.
Minep [Fri, 24 Jun 2022 10:08:17 +0000 (11:08 +0100)]
feat: experimental tty console with scrollback buffer.

3 years agoUpdate README_en.md
Lunaixsky [Wed, 22 Jun 2022 15:06:02 +0000 (16:06 +0100)]
Update README_en.md

3 years agoupdate readme
Minep [Wed, 22 Jun 2022 15:04:57 +0000 (16:04 +0100)]
update readme

3 years agoslides for multitasking (ep10)
Minep [Tue, 21 Jun 2022 21:18:01 +0000 (22:18 +0100)]
slides for multitasking (ep10)

3 years agofeat: support for SIGALRM
Minep [Tue, 21 Jun 2022 11:23:54 +0000 (12:23 +0100)]
feat: support for SIGALRM
feat: alarm(2) syscall
refactor: better sleep(3).
chore: rename the process state for compactness.

3 years agofeat: kill(2) implementation
Minep [Mon, 20 Jun 2022 23:19:49 +0000 (00:19 +0100)]
feat: kill(2) implementation
feat: support more signal (SIGKILL, SIGSTOP, SIGCONT)
fix: [interrupt.S] change to callee-save register for safety
chore: formatting, renaming things

3 years agoMerge branch 'master' of github.com:Minep/lunaix-os
Minep [Mon, 20 Jun 2022 16:21:01 +0000 (17:21 +0100)]
Merge branch 'master' of github.com:Minep/lunaix-os

3 years agoMerge branch 'signal-dev'
Minep [Mon, 20 Jun 2022 16:20:02 +0000 (17:20 +0100)]
Merge branch 'signal-dev'

3 years agofeat: pause(2) support
Minep [Mon, 20 Jun 2022 16:19:11 +0000 (17:19 +0100)]
feat: pause(2) support

3 years agoUpdate README.md
Lunaixsky [Sun, 19 Jun 2022 18:51:33 +0000 (19:51 +0100)]
Update README.md

3 years agofeat: signal support (tested!)
Minep [Sun, 19 Jun 2022 17:56:28 +0000 (18:56 +0100)]
feat: signal support (tested!)
feat: signal demo.

3 years agoedit readme
Minep [Sun, 19 Jun 2022 12:00:12 +0000 (13:00 +0100)]
edit readme

3 years agofeat: User mode support.
Minep [Sun, 19 Jun 2022 10:49:56 +0000 (11:49 +0100)]
feat: User mode support.
feat: All physical page allocations are now on-demand and being managed by PF handler.
fix: Remove the 'garbage' mapping due to reserve area locking when initialize ACPI.
refactor: alloc_pid now change to alloc_process.
chore: annonation on issues that should be fixed
chore: formatting some code.

3 years agorefactor: re-structure the kernel address space for a more integral layout.
Minep [Sat, 18 Jun 2022 18:20:22 +0000 (19:20 +0100)]
refactor: re-structure the kernel address space for a more integral layout.
fix: spwan_proc0 invoking APIC functionality before it's initialization.

3 years agochore: make things more general
Minep [Sat, 18 Jun 2022 16:27:38 +0000 (17:27 +0100)]
chore: make things more general
refactor: put a limit on kernel heap.
refactor: reduce overhead on kernel stack creation when we fork into our first process.

3 years agorefactor: vmm_set_map has option to ignore existed mapping.
Minep [Sat, 18 Jun 2022 10:16:23 +0000 (11:16 +0100)]
refactor: vmm_set_map has option to ignore existed mapping.
chore: optimize memcpy and memset with x86 feature.

3 years agorefactor: simplify the vmm design, single responsibility. But using it should with...
Minep [Fri, 17 Jun 2022 23:04:09 +0000 (00:04 +0100)]
refactor: simplify the vmm design, single responsibility. But using it should with great attention!
refactor: some formatting on code style.

3 years agorefactor: keep in mind the stack layout is crucial. Move context switching & signal...
Minep [Fri, 17 Jun 2022 15:44:15 +0000 (16:44 +0100)]
refactor: keep in mind the stack layout is crucial. Move context switching & signal handling part into asm once for all.

3 years agoMerge branch 'master' into signal-dev
Minep [Thu, 16 Jun 2022 16:20:38 +0000 (17:20 +0100)]
Merge branch 'master' into signal-dev

3 years agofix: passing intr_ctx to soft_iret corrupts the stack of next proccess when performin...
Minep [Thu, 16 Jun 2022 10:20:32 +0000 (11:20 +0100)]
fix: passing intr_ctx to soft_iret corrupts the stack of next proccess when performing context switching.

3 years agorefactor: formattings
Minep [Wed, 15 Jun 2022 20:58:30 +0000 (21:58 +0100)]
refactor: formattings
fix: avoid setpgid on group leader

3 years agoMerge branch 'master' into signal-dev
Minep [Wed, 15 Jun 2022 20:55:55 +0000 (21:55 +0100)]
Merge branch 'master' into signal-dev

3 years agofeat: pgid support
Minep [Tue, 14 Jun 2022 10:05:14 +0000 (11:05 +0100)]
feat: pgid support

3 years agofeat: add signal handling support (not tested!)
Minep [Mon, 13 Jun 2022 14:40:28 +0000 (15:40 +0100)]
feat: add signal handling support (not tested!)

3 years agofix: The timer sequence stuck in infinite loop after series of delete operation
Minep [Sat, 11 Jun 2022 23:25:28 +0000 (00:25 +0100)]
fix: The timer sequence stuck in infinite loop after series of delete operation
fix: To mitigate race condition, make the system call mask interrupt by default, and unmask when and only when needed.
improve: better debugging experience when GP happened due to the buggy iret!

3 years agofeat: The waitpid family!
Minep [Sat, 11 Jun 2022 17:12:37 +0000 (18:12 +0100)]
feat: The waitpid family!
feat: Ability to switch data segment
fix: Mitigated some race conditions
feat: Better way for process to yield current time slice.

3 years agoMerge branch 'master' of github.com:Minep/lunaix-os
Minep [Fri, 10 Jun 2022 21:43:01 +0000 (22:43 +0100)]
Merge branch 'master' of github.com:Minep/lunaix-os

3 years agorefactor: Move the kernel post init stage into proc0
Minep [Fri, 10 Jun 2022 21:37:05 +0000 (22:37 +0100)]
refactor: Move the kernel post init stage into proc0
refactor: Add a linter config. Resolved #1
refactor: Formatted some source files.
refactor: Shrink the process table size.

3 years agoCreate LICENSE
Lunaixsky [Tue, 7 Jun 2022 13:27:08 +0000 (14:27 +0100)]
Create LICENSE

3 years agofeat: No more kernel page table switching upon interrupt.
Minep [Mon, 6 Jun 2022 12:08:54 +0000 (13:08 +0100)]
feat: No more kernel page table switching upon interrupt.
feat: 'wait' syscall implementation
feat: use linked list for chaining children process.
feat: Now the allocated memory can be recycled upon process destroy.
feat: Interruptible syscall.
refactor: correct the sbrk and brk naming.
refactor: process initialization.
fix: TLB caching stall the PTE rewrite which cause fork() fail randomly.
fix: Add new process state: CREATE to avoid race during process creation.
chores: annotations on future improvements & fixes.

3 years agofeat: added ability to identify process vm regions
Minep [Tue, 31 May 2022 20:43:35 +0000 (21:43 +0100)]
feat: added ability to identify process vm regions
feat: page fault handler for COW policy
refactor: improved system call declaration experience.
feat: more system call (sleep, _exit and other process related)
feat: add ability to detect orphan process.

3 years agoKernel address space isolation and make the kernel heap global to all processes.
Minep [Mon, 30 May 2022 23:23:05 +0000 (00:23 +0100)]
Kernel address space isolation and make the kernel heap global to all processes.
And featuring initd!

3 years agobasic process support and some syscalls
Minep [Mon, 30 May 2022 00:46:55 +0000 (01:46 +0100)]
basic process support and some syscalls

3 years agoadd some references
Minep [Thu, 19 May 2022 11:20:49 +0000 (12:20 +0100)]
add some references

3 years agofix bugs and restruct some excerpts
Minep [Thu, 19 May 2022 11:17:43 +0000 (12:17 +0100)]
fix bugs and restruct some excerpts

3 years agoupdate project struct & readme
Minep [Thu, 19 May 2022 11:17:17 +0000 (12:17 +0100)]
update project struct & readme

3 years agoAdd back the missing reserved field in FADT.
Minep [Tue, 3 May 2022 22:51:48 +0000 (23:51 +0100)]
Add back the missing reserved field in FADT.
Add a FADT version check before using IAPC_BOOT_ARCH flag for 8042 existence.
Fixed the spurious IRQ#1 happens during 8042 initialization under VirtualBox environment.

3 years agoAdd FADT check for presence of i8042 controller.
Minep [Tue, 3 May 2022 15:25:45 +0000 (16:25 +0100)]
Add FADT check for presence of i8042 controller.

3 years agoImplement (half) simple semaphore & mutex lock, and ...
Minep [Tue, 3 May 2022 14:22:16 +0000 (15:22 +0100)]
Implement (half) simple semaphore & mutex lock, and ...
Use vga cursor.
Address the issue of spurious IRQ#1 which interference key hanlder when receiving the command response byte.
Refactoring and commentings.

3 years agoRestructure the interrupt vector distribution for better matching of their inherit...
Minep [Sun, 1 May 2022 15:47:38 +0000 (16:47 +0100)]
Restructure the interrupt vector distribution for better matching of their inherit priority, and ...
Attempts to resolve the spurious keyboard buffer full irq when after issuing the command to ps/2.
Adjust the comments and formatting.

3 years agoImplement shift+<key> support, and ...
Minep [Sat, 30 Apr 2022 23:31:02 +0000 (00:31 +0100)]
Implement shift+<key> support, and ...
Modifier state are now avaliable in key event state.
Bounded buffer for upper layer polls the key event.
A simple keyboard input demo added in k_main.c
Add a mutex lock on senstive region.
Fix ps/2 io bugs, LEDs should works now.

3 years agoBasic PS/2 keyboard driver, and ...
Minep [Fri, 29 Apr 2022 23:29:02 +0000 (00:29 +0100)]
Basic PS/2 keyboard driver, and ...
A bit refactoring on timer related api;
New clock api for accessing datatime & epoch stuff;
New log level: debug, is implemented in kprintf.

3 years agofix errors in slides
Minep [Sun, 13 Mar 2022 15:47:26 +0000 (15:47 +0000)]
fix errors in slides

3 years agoep8 slides
Minep [Sun, 13 Mar 2022 15:36:33 +0000 (15:36 +0000)]
ep8 slides

3 years agominor adjustments
Minep [Sun, 13 Mar 2022 15:36:13 +0000 (15:36 +0000)]
minor adjustments

3 years agoTimer re-worked!
Minep [Sat, 12 Mar 2022 18:55:50 +0000 (18:55 +0000)]
Timer re-worked!
Renamings some header files.
A linked list implementation stolen from Linux.

3 years agoImplement APIC, RTC, basic ACPI parser and timer support
Minep [Sat, 12 Mar 2022 01:21:58 +0000 (01:21 +0000)]
Implement APIC, RTC, basic ACPI parser and timer support
more flexible interrupt handler design
rename the libc to klibc to avoid the confusion between user space and kernel space c std lib
improved logging experience, the kprintf
Some shitty workarounds on vm in order to make my ACPI parser happy
Not trust on multiboot's mem map anymore!

3 years agodead simple rtc code for getting current datetime.
Minep [Sun, 6 Mar 2022 18:17:32 +0000 (18:17 +0000)]
dead simple rtc code for getting current datetime.

3 years agoadd missing slides due to renamings
Minep [Sat, 5 Mar 2022 22:05:14 +0000 (22:05 +0000)]
add missing slides due to renamings

3 years agoupdate project structures
Minep [Sat, 5 Mar 2022 21:58:23 +0000 (21:58 +0000)]
update project structures
finalize the dmm related stuff

3 years agofix bugs found in brk & add simple security checks on lx_free
Minep [Thu, 3 Mar 2022 22:37:10 +0000 (22:37 +0000)]
fix bugs found in brk & add simple security checks on lx_free

3 years agomake dmm.c portable
Minep [Thu, 3 Mar 2022 18:36:37 +0000 (18:36 +0000)]
make dmm.c portable
implement kernel heap malloc/free

3 years agoComplete (almost!) printf fmt support
Minep [Thu, 3 Mar 2022 17:36:53 +0000 (17:36 +0000)]
Complete (almost!) printf fmt support
Enriched string.h
Enhance the readability of vmm.c
Better assert & panic implementation (use syscall to panic)
Some housekeeping routines (remove warnings, restructure project folders)

3 years agogrow on demand heap
Minep [Tue, 1 Mar 2022 23:34:38 +0000 (23:34 +0000)]
grow on demand heap
add simple page fault handler for debugging
correct the accidentally used sti instruction which is too early at this stage

3 years agodynamic memory manager (malloc & free)
Minep [Tue, 1 Mar 2022 16:31:12 +0000 (16:31 +0000)]
dynamic memory manager (malloc & free)
debugging experience improved

3 years agovmm - allow remapping
Minep [Sun, 27 Feb 2022 23:46:51 +0000 (23:46 +0000)]
vmm - allow remapping
vmm,page - rename some symbols that seems make more sense
boot.S - make things more predictable
hal - more abstraction on the daily-use functionalities.
dmm - a place for dynamic heap allocation

3 years agoa bit refactoring on kernel_init
Minep [Sun, 27 Feb 2022 23:39:31 +0000 (23:39 +0000)]
a bit refactoring on kernel_init
add assertions support for debugging
add ss and esp in isr_param to handling stack switch.

3 years agoupdate readme
Minep [Sat, 26 Feb 2022 18:30:09 +0000 (18:30 +0000)]
update readme

3 years agofix gcc warnings & improved makefile echos
Minep [Sat, 26 Feb 2022 18:06:55 +0000 (18:06 +0000)]
fix gcc warnings & improved makefile echos

3 years agoep7
Minep [Sat, 26 Feb 2022 16:36:20 +0000 (16:36 +0000)]
ep7