Commit Graph
69 Commits
Author SHA1 Message Date
Aaron 4e3acd6af7 Storage system: AHCI, IDE rework, VFS, volume manager, flatfs, async IO, IOAPIC 2026-03-07 18:45:25 +00:00
t3hn3rd de6fde05cc feature: preemptive process management - implementation progress
Implement a preemptive multitasking system for the Asuro kernel.

Context Switching & Scheduling:
- Custom IRQ0 ISR (contextswitcher.pas) with PUSHAD/POPAD ESP-swap
- Round-robin scheduler with priority-based quantum
- Process table using DList of PProcessContext pointers
- Idle process (PID 0) replaces kernel HLT loop

Process Lifecycle:
- create/kill/terminate/sendMessage API (processmanager.pas)
- Process states: Created, Running, Ready, Suspended, Awaiting,
  Finished, Error
- Parent-child tracking (ParentID, smChildExited notification on reap)
- proc_yield, proc_sleep_ms, proc_await, proc_suspend, proc_exit

Resource Binding & Cleanup:
- Per-process resource list
  (bindResource/unbindResource/unbindAllResources)
- TCP sockets auto-bound to owning process (OwnerPID on TTCPSocket)
- socket_cleanup + auto-unbind in DestroySocket

VTerminal Refactor:
- Multi-instance design (heap-allocated TVTermState per terminal)
- Foreground process with incremental stdout/stderr drain via LVGL timer
- Ctrl+C kills foreground process (killForeground)
- Per-terminal CWD, dir stack, FS builtins (CD/LS/PUSHD/POPD)
- Background job support (& suffix, JOBS/FG commands)
- Command history (Up/Down arrow)

Command Consolidation:
- 14 commands extracted from 9 units into centralized progmanager.pas
- Command procedures exported in host unit interfaces
- E1000/TRACER/stdio builtins kept in-place (conditional/circular)

New Units:
- src/include/proctypes.pas — process type definitions
- src/processmanager.pas — core process manager
- src/prog/ping.pas — standalone ICMP ping process
- src/prog/testcmd.pas — test command (proc_sleep_ms demo)
- src/testprocs.pas — process subsystem smoke tests

Misc:
- ICMP callbacks gain userData parameter for concurrency-safe ping
- CLI/STI guards on kalloc/kfree (lmemorymanager.pas)
- LV_KEY_CTRLC constant + Ctrl+C interception in LVGL keyboard hook
- Window owner PID tracking (windows.pas)
- ISR_32 gate override support (isrmanager.pas)
2026-03-04 19:42:33 +00:00
t3hn3rd 7bbcc44c5e Feature: USB - Hotplug, mass storage, disconnect callbacks, dynamic device lists
- Add disconnect callback (fnDisconnect) to TUSBDevice for safe unplug handling
- Add HotplugArmed/PortChangePending flags to TUSBHCDriver for deferred
  hotplug processing from ISR context (OHCI RHSC, EHCI PCD, xHCI PSC)
- Implement usb_rescan_port() and usb_check_hotplug() in usbcore
- Add usb_bulk_transfer_wait() with timer-based timeout (bios_data_area)
- Add timer-based timeout to usb_control_msg polling loop
- Replace static device arrays with dynamic linked lists in class drivers:
  usb_keyboard (KeyboardList), usb_mouse (MouseList), usb_storage (StorageList)
- Add 3-strike fail-count self-deactivation in keyboard/mouse poll loops
- Add unload() disconnect handlers for keyboard, mouse, and storage drivers
- Implement USB Mass Storage BOT driver (usb_storage.pas):
  CBW/CSW transport, SCSI INQUIRY/READ_CAPACITY/READ10/WRITE10,
  storagemanagement integration with read/write callbacks
- xHCI: acknowledge port status change W1C bits in event handler
- Integrate usb_check_hotplug + poll_keyboards/poll_mice into kernel main loop
2026-03-02 15:52:49 +00:00
t3hn3rd f752be48ce refactor/feature/fix: Major refactor of codebase
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
refactor(stdio): replace console/terminal command system with buffer-based stdio
- Introduced stdio.pas as the unified command I/O layer.
- All 31 command procedures across 15 files now receive stdin_buf,
  stdout_buf, and stderr_buf (POutBuf) instead of a single outbuf.
- vterminal.pas creates all three buffers per command invocation and
  displays both stdout and stderr.
- Deleted console.pas, terminal.pas, and 9 obsolete windowing programs
  (shell, splash, edit, memview, themer, netlog, vmlog, vmstate, udpcat).
- Migrated all registerCommand calls to stdio, rewrote vterminal
  processCommand to use stdio.findCommand, and added proper error
  routing to stderr for invalid params, bad paths, and system errors.

refactor(syslog): replace console logging with serial-backed syslog
- Introduced syslog.pas for kernel-level logging over serial/dev.
- Migrated all boot logging in kernel.pas from console.outputln/
  writestringln to syslog.logln/writestringln.
- Converted 19 fault handlers, hashmap, lists, scheduler, tracer, net,
  udp, and all driver init paths to use syslog.
- Rewrote BSOD in util.pas (50+ calls) from console to syslog.
- Removed CONSOLE_SLOW_REDRAW, TRGB565, TRGB565Pair, and HWND
  from system.pas.

fix(keyboard): add ring buffer and proper press/release cycling for LVGL input
- Replaced the single last_key/key_pressed slot in lvgl.pas with a
  16-entry ring buffer (kb_buf, kb_head, kb_tail) to prevent ISR
  overwrites when typing fast.
- Added a kb_pending_release flag so each keystroke gets a
  full PRESSED->RELEASED cycle before the next key is consumed —
  LVGL requires this pairing and was silently dropping intermediate
  keys when receiving consecutive PRESSED events without
  intervening releases.

feat(vterminal): use Hack monospace font for terminal output
- Added Hack Regular 14px (hack_14.c) as a custom LVGL font.
- Removed the .static_bitmap field from the generated font file
  (not present in LVGL 9.2 lv_font_t struct).
- Declared the hack_14 external symbol in lvgl.pas and switched
  vterminal's text label from lv_font_montserrat_14 to hack_14
  for proper monospace terminal rendering.
2026-03-01 02:06:31 +00:00
t3hn3rd 439d4ef8ac Tidied out comments for docgen.
Added some documentation to Asuro.pas & ProgManager.
2021-07-05 19:07:33 +01:00
t3hn3rd 64b3c9a7ba Apache License
Added the apache license to all source files, accounting for authors. Also added a license.md containing the apache license + contributors.md listing all contributors.
2021-06-22 21:31:17 +01:00
t3hn3rd 224392358d Added comments to init()
Added comments to clearly indicate each step during the vfs init procedure.
2021-06-20 21:21:45 +01:00
t3hn3rd bd9fbd2da6 Added lots of stuff
Added stuff to vfs + Dockerized the compilation & added some vscode cfg.
2021-06-20 02:49:56 +01:00
kieron 99fc00450e git-svn-id: https://spexeah.com:8443/svn/Asuro@1441 6dbc8c32-bb84-406f-8558-d1cf31a0ab0c 2020-07-21 22:06:41 +00:00
kieron 50b77b9ce9 cd now works.
git-svn-id: https://spexeah.com:8443/svn/Asuro@1440 6dbc8c32-bb84-406f-8558-d1cf31a0ab0c
2020-07-21 15:56:00 +00:00
kieron d642eafe24 Added relative/absolute path functions to vfs.pas
Implemented stringContains in strings.pas

git-svn-id: https://spexeah.com:8443/svn/Asuro@1432 6dbc8c32-bb84-406f-8558-d1cf31a0ab0c
2020-07-20 22:34:28 +00:00
aaron c7c49f24d9 git-svn-id: https://spexeah.com:8443/svn/Asuro@1319 6dbc8c32-bb84-406f-8558-d1cf31a0ab0c 2020-07-18 21:01:29 +00:00
kieron 6b6129b769 Added VFS
git-svn-id: https://spexeah.com:8443/svn/Asuro@1318 6dbc8c32-bb84-406f-8558-d1cf31a0ab0c
2020-07-18 21:00:31 +00:00
aaron d4234225d1 Started rewrite of storage system.
git-svn-id: https://spexeah.com:8443/svn/Asuro@1299 6dbc8c32-bb84-406f-8558-d1cf31a0ab0c
2020-07-17 22:30:36 +00:00
aaron fd564f56b7 git-svn-id: https://spexeah.com:8443/svn/Asuro@973 6dbc8c32-bb84-406f-8558-d1cf31a0ab0c 2020-07-11 11:30:00 +00:00
aaron 86013b1125 M storage/IDE.pas
M    storage/fat32.pas
M    storage/storagemanagement.pas


git-svn-id: https://spexeah.com:8443/svn/Asuro@970 6dbc8c32-bb84-406f-8558-d1cf31a0ab0c
2020-07-11 00:32:59 +00:00
kieron 1dcfc4e7eb Big commit thing.
git-svn-id: https://spexeah.com:8443/svn/Asuro@867 6dbc8c32-bb84-406f-8558-d1cf31a0ab0c
2020-07-08 21:42:55 +00:00
kieron 4935fbc9aa Tried fixes for IDE on VMWare Workbench - doesn't crash on start anymore, but does crash after format.
git-svn-id: https://spexeah.com:8443/svn/Asuro@796 6dbc8c32-bb84-406f-8558-d1cf31a0ab0c
2019-03-12 11:12:12 +00:00
kieron b2c9d8228c Fixed a bug when reading from IDE status ports using inw instead of inb.
git-svn-id: https://spexeah.com:8443/svn/Asuro@776 6dbc8c32-bb84-406f-8558-d1cf31a0ab0c
2019-03-11 20:14:29 +00:00
aaron 6330b1bc72 git-svn-id: https://spexeah.com:8443/svn/Asuro@759 6dbc8c32-bb84-406f-8558-d1cf31a0ab0c 2019-01-25 15:20:48 +00:00
aaron 476a189b21 git-svn-id: https://spexeah.com:8443/svn/Asuro@757 6dbc8c32-bb84-406f-8558-d1cf31a0ab0c 2019-01-25 14:17:09 +00:00
aaron cdf2267a25 git-svn-id: https://spexeah.com:8443/svn/Asuro@756 6dbc8c32-bb84-406f-8558-d1cf31a0ab0c 2018-10-27 06:40:37 +00:00
aaron a50e770c1a git-svn-id: https://spexeah.com:8443/svn/Asuro@755 6dbc8c32-bb84-406f-8558-d1cf31a0ab0c 2018-10-27 06:30:17 +00:00
aaron 4a1d7a942d git-svn-id: https://spexeah.com:8443/svn/Asuro@745 6dbc8c32-bb84-406f-8558-d1cf31a0ab0c 2018-05-19 23:31:53 +00:00
aaron 24027a3109 git-svn-id: https://spexeah.com:8443/svn/Asuro@727 6dbc8c32-bb84-406f-8558-d1cf31a0ab0c 2018-05-12 15:18:04 +00:00
aaron 10b0fc8c40 git-svn-id: https://spexeah.com:8443/svn/Asuro@675 6dbc8c32-bb84-406f-8558-d1cf31a0ab0c 2018-05-08 09:04:19 +00:00
aaron 680b758ee7 git-svn-id: https://spexeah.com:8443/svn/Asuro@673 6dbc8c32-bb84-406f-8558-d1cf31a0ab0c 2018-05-07 23:45:38 +00:00
aaron 956588c920 git-svn-id: https://spexeah.com:8443/svn/Asuro@669 6dbc8c32-bb84-406f-8558-d1cf31a0ab0c 2018-05-07 21:43:40 +00:00
aaron bccc36132e git-svn-id: https://spexeah.com:8443/svn/Asuro@666 6dbc8c32-bb84-406f-8558-d1cf31a0ab0c 2018-05-05 21:37:35 +00:00
aaron d4b9c55000 git-svn-id: https://spexeah.com:8443/svn/Asuro@660 6dbc8c32-bb84-406f-8558-d1cf31a0ab0c 2018-05-04 21:50:09 +00:00
aaron c85f22622e git-svn-id: https://spexeah.com:8443/svn/Asuro@659 6dbc8c32-bb84-406f-8558-d1cf31a0ab0c 2018-05-04 15:46:48 +00:00
kieron b42c7641e6 git-svn-id: https://spexeah.com:8443/svn/Asuro@651 6dbc8c32-bb84-406f-8558-d1cf31a0ab0c 2018-05-02 17:17:58 +00:00
aaron 58bf1ae93d git-svn-id: https://spexeah.com:8443/svn/Asuro@612 6dbc8c32-bb84-406f-8558-d1cf31a0ab0c 2018-04-30 22:04:50 +00:00
aaron 2d902a1380 git-svn-id: https://spexeah.com:8443/svn/Asuro@594 6dbc8c32-bb84-406f-8558-d1cf31a0ab0c 2018-04-29 17:34:57 +00:00
aaron 68ccd2bdf7 git-svn-id: https://spexeah.com:8443/svn/Asuro@551 6dbc8c32-bb84-406f-8558-d1cf31a0ab0c 2018-04-27 14:35:06 +00:00
aaron d662659273 git-svn-id: https://spexeah.com:8443/svn/Asuro@549 6dbc8c32-bb84-406f-8558-d1cf31a0ab0c 2018-04-27 10:01:40 +00:00
aaron 1e78c537aa git-svn-id: https://spexeah.com:8443/svn/Asuro@531 6dbc8c32-bb84-406f-8558-d1cf31a0ab0c 2018-04-15 06:28:44 +00:00
aaron b7523db308 git-svn-id: https://spexeah.com:8443/svn/Asuro@530 6dbc8c32-bb84-406f-8558-d1cf31a0ab0c 2018-04-15 05:00:59 +00:00
aaron 383f36bad3 git-svn-id: https://spexeah.com:8443/svn/Asuro@517 6dbc8c32-bb84-406f-8558-d1cf31a0ab0c 2018-04-13 18:59:19 +00:00
kieron aae55ef2ec git-svn-id: https://spexeah.com:8443/svn/Asuro@513 6dbc8c32-bb84-406f-8558-d1cf31a0ab0c 2018-04-12 20:32:56 +00:00
kieron c514e7dc83 git-svn-id: https://spexeah.com:8443/svn/Asuro@512 6dbc8c32-bb84-406f-8558-d1cf31a0ab0c 2018-04-12 16:51:19 +00:00
aaron af8eb56058 git-svn-id: https://spexeah.com:8443/svn/Asuro@508 6dbc8c32-bb84-406f-8558-d1cf31a0ab0c 2018-04-12 15:17:59 +00:00
kieron 3124582151 git-svn-id: https://spexeah.com:8443/svn/Asuro@507 6dbc8c32-bb84-406f-8558-d1cf31a0ab0c 2018-04-12 14:38:50 +00:00
aaron c6ed6453e0 git-svn-id: https://spexeah.com:8443/svn/Asuro@503 6dbc8c32-bb84-406f-8558-d1cf31a0ab0c 2018-04-11 22:16:19 +00:00
aaron f1beeca4c4 git-svn-id: https://spexeah.com:8443/svn/Asuro@502 6dbc8c32-bb84-406f-8558-d1cf31a0ab0c 2018-04-11 22:14:08 +00:00
aaron 5f39ce826f git-svn-id: https://spexeah.com:8443/svn/Asuro@498 6dbc8c32-bb84-406f-8558-d1cf31a0ab0c 2018-04-11 19:34:08 +00:00
aaron 7303cb9dd7 git-svn-id: https://spexeah.com:8443/svn/Asuro@495 6dbc8c32-bb84-406f-8558-d1cf31a0ab0c 2018-04-11 15:52:32 +00:00
aaron 2d73017379 git-svn-id: https://spexeah.com:8443/svn/Asuro@492 6dbc8c32-bb84-406f-8558-d1cf31a0ab0c 2018-04-11 14:59:37 +00:00
aaron a51487a800 git-svn-id: https://spexeah.com:8443/svn/Asuro@489 6dbc8c32-bb84-406f-8558-d1cf31a0ab0c 2018-04-11 14:37:05 +00:00
kieron c8b3b14893 git-svn-id: https://spexeah.com:8443/svn/Asuro@484 6dbc8c32-bb84-406f-8558-d1cf31a0ab0c 2018-04-11 14:21:06 +00:00