x86_64 do not merge #76

Open
Aaron wants to merge 9 commits from 64bit into feature/sotrage-system-overhaul
pull from: 64bit
7 changed files with 734 additions and 50 deletions
Showing only changes of commit e69b134bff - Show all commits

No files matched your search

+218 -8
View File
File diff suppressed because it is too large. Load diff
+1 -17
View File
@@ -23,10 +23,9 @@ unit app.mgr;
interface interface
uses uses
boot.mgr,
debug.tracer, io.stdio, proc.mgr, debug.tracer, io.stdio, proc.mgr,
//progs //progs
app.base64, app.md5sum, app.dhclient, app.vbeinfo, app.testcmd, app.ping, app.meminfo, app.setres, app.iotest, app.base64, app.md5sum, app.dhclient, app.testcmd, app.ping, app.meminfo, app.setres,
//drivers //drivers
driver.storage.ctl.ram, driver.mgr, driver.storage.ctl.ram, driver.mgr,
//network //network
@@ -35,8 +34,6 @@ uses
driver.storage.filedispatch, driver.storage.filedispatch,
//wasm //wasm
app.wasm.runner, app.wasm.runner,
app.divzero,
app.bsod,
app.vterminal; app.vterminal;
{ Initialize all baked-in programs } { Initialize all baked-in programs }
@@ -47,7 +44,6 @@ implementation
uses uses
core.version, core.version,
//command provider units //command provider units
arch.x86.cpu,
app.diskcmd, driver.bus.usb.core, app.diskutil, app.notepad, app.partcmd, app.volcmd, app.diskcmd, driver.bus.usb.core, app.diskutil, app.notepad, app.partcmd, app.volcmd,
app.filebrowser; app.filebrowser;
@@ -56,16 +52,10 @@ begin
debug.tracer.push_trace('app.mgr.init'); debug.tracer.push_trace('app.mgr.init');
{ Register commands from provider units } { Register commands from provider units }
io.stdio.registerCommand('CPU', @arch.x86.cpu.Terminal_Command_CPU, 'CPU Info.');
io.stdio.registerCommand('DEV', @driver.mgr.terminal_command_dev, 'Driver Management Interface.'); io.stdio.registerCommand('DEV', @driver.mgr.terminal_command_dev, 'Driver Management Interface.');
io.stdio.registerCommand('PS', @proc.mgr.terminal_command_ps, 'List running processes.'); io.stdio.registerCommand('PS', @proc.mgr.terminal_command_ps, 'List running processes.');
io.stdio.registerCommand('KILL', @proc.mgr.terminal_command_kill, 'Force-kill a process by PID.'); io.stdio.registerCommand('KILL', @proc.mgr.terminal_command_kill, 'Force-kill a process by PID.');
io.stdio.registerCommand('TERMINATE', @proc.mgr.terminal_command_terminate, 'Gracefully terminate a process by PID.'); io.stdio.registerCommand('TERMINATE', @proc.mgr.terminal_command_terminate, 'Gracefully terminate a process by PID.');
io.stdio.registerCommand('ARP', @driver.net.proto.arp.terminal_command_arp, 'Get ARP Table.');
io.stdio.registerCommand('IFCONFIG', @driver.net.proto.ipv4.terminal_command_ifconfig, 'Configure Network Settings.');
io.stdio.registerCommand('TCPCONNECT', @driver.net.proto.tcp.terminal_command_tcpconnect, 'Connect to a TCP host and send Hello World.');
io.stdio.registerCommand('TCPLISTEN', @driver.net.proto.tcp.terminal_command_tcplisten, 'Listen on a TCP port and log received data.');
io.stdio.registerCommand('TCPHTTP', @driver.net.proto.tcp.terminal_command_tcphttp, 'Send HTTP GET to a host IP (port 80 default).');
io.stdio.registerCommand('USB', @driver.bus.usb.core.terminal_command_usb, 'driver.bus.usb subsystem information.'); io.stdio.registerCommand('USB', @driver.bus.usb.core.terminal_command_usb, 'driver.bus.usb subsystem information.');
{ File dispatch — must init before apps that register handlers } { File dispatch — must init before apps that register handlers }
@@ -81,21 +71,15 @@ begin
app.md5sum.init(); app.md5sum.init();
app.base64.init(); app.base64.init();
app.dhclient.init(); app.dhclient.init();
app.vbeinfo.init();
app.testcmd.init(); app.testcmd.init();
app.ping.init(); app.ping.init();
app.meminfo.init(); app.meminfo.init();
{ WASM & remaining apps } { WASM & remaining apps }
app.wasm.runner.init(); app.wasm.runner.init();
app.setres.init(); app.setres.init();
app.divzero.init();
app.bsod.init();
app.vterminal.init; app.vterminal.init;
app.filebrowser.init(); app.filebrowser.init();
app.iotest.init();
end; end;
Initialization
boot.mgr.registerBoot('app.mgr', @init, 'Program Manager', BOOT_MGR_BARRIER_LATE);
end. end.
+99 -2
View File
@@ -12,12 +12,109 @@
{ Compose shared services with the i386 boot manager and platform commands. } { Compose shared services with the i386 boot manager and platform commands. }
unit arch.x86.startup; unit arch.x86.startup;
interface interface
implementation implementation
uses boot.mgr, memory.heap, proc.mgr, io.stdio, arch.x86.console; uses
app.mgr, app.vbeinfo, app.divzero, app.bsod, app.iotest, arch.x86.cpu,
driver.net,
driver.video.desktop, driver.timer.rtc, svc.gfxd,
app.uidebug,
driver.video.bga, driver.video, driver.video.gpu, driver.video.vesa,
driver.video.doublebuffer, driver.video.lvgl,
driver.hid.usb.keyboard,
driver.hid.usb.mouse,
driver.hid.ps2.keyboard, driver.hid.ps2.mouse,
driver.storage.ctl.usb,
driver.storage.metatest,
driver.mgr,
driver.bus.pci,
driver.storage.ctl.ahci,
driver.storage.mgr,
driver.storage.vfs,
driver.storage.vol.mgr,
driver.storage.fs.flatfs,
driver.storage.fs.iso9660,
driver.storage.fs.ext2,
driver.storage.fs.fat32,
driver.io.serial,
io.syslog,
debug.tracer,
driver.storage.fs.mgr,
boot.mgr,
memory.heap,
proc.mgr,
io.stdio,
arch.x86.console;
procedure initApps;
begin
app.mgr.init;
io.stdio.registerCommand('CPU', @arch.x86.cpu.Terminal_Command_CPU, 'CPU Info.');
app.vbeinfo.init;
app.divzero.init;
app.bsod.init;
app.iotest.init;
end;
procedure consoleInit; procedure consoleInit;
begin io.stdio.init; arch.x86.console.init; end; begin
io.stdio.init;
arch.x86.console.init;
end;
procedure lateInit();
begin
driver.video.vesa.init(@driver.video.register);
driver.video.doublebuffer.init(@driver.video.register);
io.syslog.logln('VIDEO', 'VESA Enable.');
driver.video.enable('VESA');
io.syslog.logln('VIDEO', 'Double Buffer Enable.');
driver.video.enable('BASIC_DOUBLE_BUFFER');
{ Initialize LVGL early so the boot.splash screen can use it }
io.syslog.logln('VIDEO', 'LVGL: INIT BEGIN.');
lvgl_init(driver.video.frontBufferWidth, driver.video.frontBufferHeight);
io.syslog.logln('VIDEO', 'LVGL: INIT END.');
end;
initialization initialization
boot.mgr.registerBoot('app.mgr', @initApps, 'Program Manager', BOOT_MGR_BARRIER_LATE);
boot.mgr.registerBoot('driver.video.bga', @driver.video.bga.init, 'BGA Display Driver Initialization', 'driver.video');
boot.mgr.registerBoot('driver.net', @driver.net.init, 'Net Driver', BOOT_MGR_BARRIER_DEVICE);
boot.mgr.registerBoot('driver.hid.ps2.keyboard', @driver.hid.ps2.keyboard.init, 'PS/2 Keyboard Driver', BOOT_MGR_BARRIER_DEVICE);
boot.mgr.registerBoot('driver.hid.ps2.mouse', @driver.hid.ps2.mouse.init, 'PS/2 Mouse Driver', BOOT_MGR_BARRIER_DEVICE);
boot.mgr.registerBoot('proc.desktop', @driver.video.desktop.init, 'Initialize Desktop', 'boot.splash.teardown');
boot.mgr.registerBoot('svc.gfxd', @svc.gfxd.init, 'GFX Daemon', BOOT_MGR_BARRIER_LATE);
boot.mgr.registerBoot('driver.timer.rtc', @driver.timer.rtc.init, 'Real Time Clock Driver', 'arch.x86.fault');
boot.mgr.registerBoot('driver.video', @driver.video.init, 'Video Driver Initialization', 'driver.video.gpu');
boot.mgr.registerBoot('driver.video.gpu', @driver.video.gpu.init, 'GPU Framework', BOOT_MGR_BARRIER_EARLY);
boot.mgr.registerBoot('driver.video_late', @lateInit, 'Video Driver Late Initialization', 'driver.video.*');
driver.video.lvgl.onDebugToggle := @app.uidebug.toggle;
driver.hid.usb.keyboard.onAttach := @driver.hid.ps2.keyboard.disable;
boot.mgr.registerBoot('driver.hid.usb.keyboard', @driver.hid.usb.keyboard.init, 'USB Keyboard Driver', BOOT_MGR_BARRIER_DEVICE);
boot.mgr.registerBoot('driver.hid.usb.mouse', @driver.hid.usb.mouse.init, 'USB Mouse Driver', BOOT_MGR_BARRIER_DEVICE);
boot.mgr.registerBoot('driver.storage.ctl.usb', @driver.storage.ctl.usb.init, 'USB Mass Storage Driver', BOOT_MGR_BARRIER_DEVICE);
boot.mgr.registerBoot('driver.storage.metatest', @driver.storage.metatest.init, 'Storage Metadata Tests', BOOT_MGR_BARRIER_MID);
boot.mgr.registerBoot('driver.mgr', @driver.mgr.init, 'Driver Manager Initialization', BOOT_MGR_BARRIER_MID);
boot.mgr.registerBoot('driver.bus.pci', @driver.bus.pci.Init, 'PCI Bus Driver', BOOT_MGR_BARRIER_BUS_LATE);
boot.mgr.registerBoot('driver.storage.ctl.ahci', @driver.storage.ctl.ahci.init, 'AHCI Controller', 'driver.storage.fs.*');
boot.mgr.registerBoot('driver.storage.mgr', @driver.storage.mgr.init, 'Storage Manager', 'driver.storage.vfs');
boot.mgr.registerBoot('driver.storage.vfs', @driver.storage.vfs.init, 'Virtual File System', BOOT_MGR_BARRIER_STORAGE);
boot.mgr.registerBoot('driver.storage.vol.mount', @driver.storage.vfs.auto_mount_volumes, 'Mount Storage Volumes', BOOT_MGR_BARRIER_LATE);
boot.mgr.registerBoot('driver.storage.vol.mgr', @driver.storage.vol.mgr.init, 'Volume Manager', 'driver.storage.mgr*');
boot.mgr.registerBoot('driver.storage.fs.flatfs', @driver.storage.fs.flatfs.init, 'FlatFS Filesystem', 'driver.storage.fs.mgr');
boot.mgr.registerBoot('driver.storage.fs.iso9660', @driver.storage.fs.iso9660.Init, 'IS9660 File System', 'driver.storage.fs.mgr');
boot.mgr.registerBoot('driver.storage.fs.ext2',@driver.storage.fs.ext2.init,'Ext2 Filesystem','driver.storage.fs.mgr');
boot.mgr.registerBoot('driver.storage.ext2.worker',@driver.storage.fs.ext2.StartWorker,'Ext2 I/O Worker','proc.mgr');
boot.mgr.registerBoot('driver.storage.fs.fat32', @driver.storage.fs.fat32.init, 'FAT32 Filesystem', 'driver.storage.fs.mgr');
boot.mgr.registerBoot('driver.io.serial', @driver.io.serial.init, 'Serial Interface', 'immediate');
boot.mgr.registerBoot('io.syslog', @io.syslog.init, 'Syslog Interface', 'driver.io.serial');
boot.mgr.registerBoot('debug.tracer.freeze', @debug.tracer.freeze, 'Debug Tracer Freeze', 'io.syslog' );
boot.mgr.registerBoot('debug.tracer', @debug.tracer.init, 'Debug Tracer Initialization', 'io.stdio' );
boot.mgr.registerBoot('driver.storage.fs.mgr', @driver.storage.fs.mgr.init, 'Filesystem Manager', 'driver.storage.vol.mgr');
boot.mgr.registerBoot('memory.heap', @memory.heap.init, 'Heap Memory Manager', 'arch.*.memory.*'); boot.mgr.registerBoot('memory.heap', @memory.heap.init, 'Heap Memory Manager', 'arch.*.memory.*');
boot.mgr.registerBoot('io.stdio', @consoleInit, 'Standard I/O Abstraction', BOOT_MGR_BARRIER_EARLY); boot.mgr.registerBoot('io.stdio', @consoleInit, 'Standard I/O Abstraction', BOOT_MGR_BARRIER_EARLY);
boot.mgr.registerBoot('proc.mgr', @proc.mgr.init, 'Process Manager', 'driver.storage.fs*'); boot.mgr.registerBoot('proc.mgr', @proc.mgr.init, 'Process Manager', 'driver.storage.fs*');
File diff suppressed because it is too large. Load diff
+8
View File
@@ -29,6 +29,9 @@ implementation
uses uses
core.strings, core.strings,
core.ds.lists,
core.ds.hashmap,
driver.storage.iorequest, driver.storage.path, driver.storage.fs.mgr,
app.diskutil, app.diskutil,
driver.bus.usb.types, driver.bus.usb.types,
driver.bus.usb.core, driver.bus.usb.core,
@@ -69,6 +72,11 @@ procedure runAllTests();
begin begin
{ Run unit tests } { Run unit tests }
core.strings.UnitTest; core.strings.UnitTest;
core.ds.lists.TestAllLists;
core.ds.hashmap.UnitTest;
driver.storage.iorequest.UnitTest;
driver.storage.path.UnitTest;
driver.storage.fs.mgr.UnitTest;
app.diskutil.UnitTest; app.diskutil.UnitTest;
driver.bus.usb.types.UnitTest; driver.bus.usb.types.UnitTest;
driver.bus.usb.core.UnitTest; driver.bus.usb.core.UnitTest;
+3 -3
View File
@@ -13,12 +13,12 @@
PASCAL_COMPILER=ppcx64 PASCAL_COMPILER=ppcx64
PASCAL_ENTRY="$ARCH_SOURCE_ROOT/arch.$ASURO_ARCH.boot.pas" PASCAL_ENTRY="$ARCH_SOURCE_ROOT/arch.$ASURO_ARCH.boot.pas"
PASCAL_OPTIONS=(-O2) PASCAL_OPTIONS=(-O2)
C_TARGET_OPTIONS=(-m64) C_TARGET_OPTIONS=(-m64 -mno-red-zone)
NASM_FORMAT=elf64 NASM_FORMAT=elf64
LD_FORMAT=elf_x86_64 LD_FORMAT=elf_x86_64
LINKER_SCRIPT="$TARGET_TOOLCHAIN_DIR/linker.script" LINKER_SCRIPT="$TARGET_TOOLCHAIN_DIR/linker.script"
# The bootstrap does not depend on the desktop or hosted runtime. # Native desktop and runtime sources follow the selected entry unit's dependencies.
BUILD_STEPS=(stub sources link isogen) BUILD_STEPS=(stub vergen lvgl sources initcalls link isogen)
case "${ASURO_BOOT_TEST:-none}" in case "${ASURO_BOOT_TEST:-none}" in
none) ;; none) ;;
ud|pf|df) PASCAL_OPTIONS+=("-dASURO_TEST_${ASURO_BOOT_TEST^^}") ;; ud|pf|df) PASCAL_OPTIONS+=("-dASURO_TEST_${ASURO_BOOT_TEST^^}") ;;
File diff suppressed because it is too large. Load diff