├── README.adoc ├── components ├── linux │ ├── .gitignore │ ├── misc │ │ └── _paths.py │ └── spec │ │ └── linux.xml ├── example │ ├── spec │ │ └── .gitignore │ ├── .gitignore │ ├── doc │ │ ├── restart-event.xml │ │ ├── bib.bib │ │ ├── subject-monitor-interrupts.xml │ │ ├── machine_attribute.ads │ │ ├── restart-cspec.xml │ │ ├── sm_policy_trap.xml │ │ ├── restart-memory.xml │ │ ├── restart-subject.xml │ │ ├── event_driven_main_loop.adb │ │ ├── subject_init_fsm.dot │ │ └── system_yield_sleep.xml │ └── src │ │ ├── blkwrite │ │ └── disabled │ │ │ └── muenblock_example-write_ops.adb │ │ ├── muenblock_example-write_ops.ads │ │ ├── muenblock_client │ │ └── disabled │ │ │ └── muenblock_example.ads │ │ ├── log.ads │ │ ├── memory_fills.ads │ │ ├── fpu.ads │ │ ├── foo-receiver.ads │ │ ├── foo-sender.ads │ │ └── exceptions.ads ├── .gitignore ├── idle │ ├── spec │ │ └── idle.xml │ ├── idle.gpr │ └── src │ │ └── idle.adb ├── sl │ ├── release │ │ └── debug_ops.ads │ ├── spec │ │ └── sl.xml │ └── debug │ │ └── debug_ops.ads ├── libmutime │ ├── tests │ │ ├── src │ │ │ ├── libmutime_component.ads │ │ │ └── libmutime_component-channels.ads │ │ ├── mutime-test_data.ads │ │ ├── mutime-info-test_data.ads │ │ ├── mutime-utils-test_data.ads │ │ ├── mutime-test_data.adb │ │ ├── mutime-info-test_data.adb │ │ └── mutime-utils-test_data.adb │ └── spec │ │ └── libmutime.xml ├── libmuinit │ └── spec │ │ └── libmuinit.xml ├── isolation_tests │ ├── misc │ │ └── _paths.py │ ├── spec │ │ └── isolation_tests.xml │ ├── src │ │ ├── its-fpu.ads │ │ ├── its-events.ads │ │ └── its-io_ports.ads │ └── isolation_tests.gpr ├── src │ ├── muenblock-request_channel-reader.ads │ ├── muenblock-response_channel-reader.ads │ ├── muenblock-request_channel-writer_instance.ads │ ├── muenblock-response_channel-writer_instance.ads │ ├── muenblock-request_channel.ads │ ├── muenblock-response_channel.ads │ ├── input-event_channel-reader.ads │ ├── input-event_channel-writer_instance.ads │ ├── stub.S │ └── input-event_channel.ads ├── libmudebuglog │ ├── spec │ │ └── libmudebuglog.xml │ └── misc │ │ └── config.xsl ├── libmudm │ └── spec │ │ └── libmudm.xml ├── dm │ ├── spec │ │ └── dm.xml │ ├── src │ │ ├── dev_mngr.ads │ │ ├── dev_mngr-sender.ads │ │ └── dev_mngr-receiver.ads │ └── dm.gpr ├── libmucontrol │ └── spec │ │ └── libmucontrol.xml ├── isolation_tests_monitor │ ├── spec │ │ └── isolation_tests_monitor.xml │ └── isolation_tests_monitor.gpr ├── muinit │ ├── spec │ │ └── muinit.xml │ └── muinit.ld ├── libmusinfo │ └── tests │ │ ├── musinfo-utils-test_data.ads │ │ └── musinfo-utils-test_data.adb ├── time │ ├── spec │ │ └── time.xml │ ├── src │ │ ├── tm.ads │ │ ├── time.adb │ │ ├── tm-utils.ads │ │ └── tm-main.ads │ └── time.gpr ├── sm │ ├── misc │ │ ├── gpr.xsl │ │ └── config.xsl │ ├── src │ │ ├── devices.ads │ │ ├── exit_handlers.ads │ │ ├── exit_handlers-cr_access.ads │ │ ├── interrupt_handler.adb │ │ ├── exit_handlers-rdmsr.ads │ │ └── exit_handlers-wrmsr.ads │ └── spec │ │ └── sm.xml ├── ps2_drv │ ├── spec │ │ └── ps2_drv.xml │ ├── src │ │ ├── ps2.ads │ │ ├── log.ads │ │ ├── ps2-keyboard.ads │ │ ├── ps2-mouse.ads │ │ ├── ps2-output.ads │ │ └── interrupt_handler.ads │ └── ps2_drv.gpr ├── ahci_drv │ ├── README.md │ ├── src │ │ ├── server.ads │ │ └── ahci-constants.ads │ └── ahci_drv.gpr ├── dbgserver │ ├── src │ │ ├── sinks │ │ │ ├── shmem │ │ │ │ ├── enabled │ │ │ │ │ ├── dbg-shared_memory-stream-writer.ads │ │ │ │ │ ├── dbg-shared_memory-stream-writer_instance.ads │ │ │ │ │ ├── dbg-shared_memory-types.ads │ │ │ │ │ └── dbg-shared_memory-stream.ads │ │ │ │ ├── disabled │ │ │ │ │ └── dbg-shared_memory.adb │ │ │ │ └── dbg-shared_memory.ads │ │ │ ├── pcspkr │ │ │ │ ├── dbg-pc_speaker_dbg.ads │ │ │ │ └── disabled │ │ │ │ │ └── dbg-pc_speaker_dbg.adb │ │ │ ├── serial │ │ │ │ ├── disabled │ │ │ │ │ └── dbg-serial.adb │ │ │ │ ├── enabled │ │ │ │ │ └── uart │ │ │ │ │ │ └── dbg-serial-uart.ads │ │ │ │ └── dbg-serial.ads │ │ │ └── xhcidbg │ │ │ │ ├── disabled │ │ │ │ └── dbg-xhci_dbg.adb │ │ │ │ └── dbg-xhci_dbg.ads │ │ ├── dbgserver.adb │ │ ├── dbg-crash_audit.ads │ │ ├── subject_consoles │ │ │ └── enabled │ │ │ │ ├── dbg-subject_consoles-stream-reader.ads │ │ │ │ └── dbg-subject_consoles-stream-writer_instance.ads │ │ └── dbg.ads │ └── misc │ │ └── gpr.xsl ├── vt │ ├── src │ │ ├── log.ads │ │ ├── input_events.ads │ │ ├── interrupt_handler.ads │ │ ├── mux.ads │ │ └── mux-screens.ads │ └── vt.gpr ├── controller │ ├── spec │ │ └── controller.xml │ ├── src │ │ └── controller.adb │ └── controller.gpr ├── tau0 │ ├── src │ │ ├── tau0_kernel_iface.ads │ │ └── tau0.adb │ └── tau0.gpr └── component_spark.gpr ├── deploy ├── .gitignore ├── memdisk.tar.xz ├── args.sh ├── boot.cfg ├── lighttpd.conf ├── start_shutdown_egctl.sh └── start_shutdown_epc.sh ├── emulate ├── screenrc ├── .gitignore ├── menu.lst ├── keys │ └── testkey.pub ├── grub.cfg.efi └── grub.cfg ├── policy ├── .gitignore ├── platform │ ├── qemu-kvm-efi.xml │ ├── qemu-kvm-coreboot.xml │ ├── intel-nuc-6cayh-efi.xml │ ├── up-squared-e3950-coreboot.xml │ └── intel-nuc-6i7kyk.xml ├── scheduling │ └── static │ │ ├── mirage-solo5.xml │ │ ├── demo_system_vtd.xml │ │ ├── integration_tests.xml │ │ ├── mirage-solo5-lenovo-t430s.xml │ │ ├── mirage-solo5-lenovo-t440s.xml │ │ ├── mirage-solo5-lenovo-x260.xml │ │ ├── demo_system_vtd-lenovo-t430s.xml │ │ ├── demo_system_vtd-lenovo-t440s.xml │ │ ├── demo_system_vtd-lenovo-x260.xml │ │ ├── integration_tests-qemu-kvm.xml │ │ ├── mirage-solo5-intel-nuc-5i5myhe.xml │ │ ├── mirage-solo5-qemu-kvm-efi.xml │ │ ├── demo_system_vtd-intel-nuc-5i5myhe.xml │ │ ├── demo_system_vtd-qemu-kvm-efi.xml │ │ ├── integration_tests-lenovo-t430s.xml │ │ ├── integration_tests-lenovo-t440s.xml │ │ ├── integration_tests-lenovo-x260.xml │ │ ├── demo_system_vtd-qemu-kvm-coreboot.xml │ │ ├── integration_tests-intel-nuc-5i5myhe.xml │ │ ├── integration_tests-intel-nuc-6cayh.xml │ │ ├── integration_tests-qemu-kvm-efi.xml │ │ ├── integration_tests-qemu-kvm-coreboot.xml │ │ └── integration_tests-intel-nuc-6cayh-efi.xml ├── xml │ ├── .gitignore │ ├── mirageos │ │ └── _paths.py │ ├── memory_ahci.xml │ ├── memory_xhci_dma.xml │ ├── subject_dbgserver_genode.xml │ ├── subject_its.xml │ ├── common_expressions.xml │ ├── subject_nic_sl.xml │ ├── subject_itsm.xml │ ├── subject_nic_dm.xml │ ├── subject_storage_dm.xml │ ├── subject_time.xml │ ├── subject_ps2.xml │ ├── subject_ahci.xml │ ├── subject_dbgserver_common.xml │ ├── common_events.xml │ ├── subject_storage_sm.xml │ ├── smp │ │ └── subj_sm.xml │ ├── subject_vt.xml │ └── subject_example.xml └── hardware │ └── common_hardware.xml ├── .gitattributes ├── kernel ├── .gitignore ├── release │ ├── sk-kc.ads │ ├── sk-dump.ads │ ├── sk-vtd-dump.ads │ ├── sk-subjects-debug.ads │ └── sk-vtd-debug.ads ├── spark │ └── sk-vtd-dump.ads ├── src │ ├── asm │ │ └── gdt.h │ ├── sk-mcu__disabled.adb │ ├── sk-delays.ads │ └── sk-vtd-interrupts.ads ├── doc │ ├── graph_major_frame.tex │ ├── graph_scheduling_entities.tex │ ├── graph_operation.tex │ ├── graph_scheduling_plan.tex │ ├── tikzstyle.tex │ ├── graph_sk0.tex │ └── graph_spark.tex ├── kernel_debug.gpr └── debug │ ├── console │ ├── serial │ │ ├── uart │ │ │ ├── sk-console_uart.ads │ │ │ ├── sk-uart_pkg.ads │ │ │ └── sk-kc.ads │ │ ├── hsuart │ │ │ ├── sk-console_hsuart.ads │ │ │ ├── sk-kc.ads │ │ │ └── sk-uart_pkg.ads │ │ └── sk-console_serial.ads │ ├── vga │ │ ├── sk-kc.ads │ │ └── sk-legacy_vga.ads │ └── none │ │ └── sk-kc.ads │ ├── sk-debug_lock.ads │ └── sk-subjects-debug.ads ├── doc ├── images │ └── muen.pdf ├── .gitignore ├── report │ ├── images │ │ ├── muen.pdf │ │ └── src │ │ │ └── muen.svgz │ ├── lst_trap_table.tex │ ├── lst_event_table.tex │ ├── lst_spark.tex │ ├── .gitignore │ ├── graph_object_analysis.tex │ ├── graph_vmm_type1.tex │ ├── scripts │ │ └── svg_remove_link_img.sh │ ├── graph_vmm_type2.tex │ ├── standalone_image.tex │ ├── graph_arch_overview.tex │ ├── graph_init_mem_layout_example.tex │ ├── graph_policy_compilation.tex │ ├── graph_major_frame.tex │ ├── graph_external_interrupt.tex │ ├── graph_scheduler.tex │ ├── graph_image_packaging.tex │ ├── graph_build_process.tex │ ├── graph_vmm_lifecycle.tex │ ├── tikzstyle.tex │ ├── graph_address_translation.tex │ ├── graph_arch_example.tex │ ├── graph_phys_mem_layout_example.tex │ ├── graph_scheduling_plan.tex │ ├── graph_intel_architecture.tex │ ├── files │ │ └── restrictions.adc │ ├── graph_virt_mem_layout_example.tex │ ├── impl_debug.tex │ ├── graph_apic.tex │ ├── acknowledgments.tex │ ├── design.tex │ └── graph_mp_overview.tex ├── articles │ └── images │ │ └── https-mirageos-muen.jpg └── toolchain │ └── tikzstyle.tex ├── .gitignore ├── AUTHORS ├── .arcconfig ├── .arclint └── .gitmodules /README.adoc: -------------------------------------------------------------------------------- 1 | README -------------------------------------------------------------------------------- /components/linux/.gitignore: -------------------------------------------------------------------------------- 1 | .built 2 | -------------------------------------------------------------------------------- /deploy/.gitignore: -------------------------------------------------------------------------------- 1 | .server 2 | http 3 | -------------------------------------------------------------------------------- /emulate/screenrc: -------------------------------------------------------------------------------- 1 | logfile emulate.out 2 | -------------------------------------------------------------------------------- /policy/.gitignore: -------------------------------------------------------------------------------- 1 | .validated 2 | .gen-* 3 | -------------------------------------------------------------------------------- /policy/platform/qemu-kvm-efi.xml: -------------------------------------------------------------------------------- 1 | qemu-kvm.xml -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | *.ads diff=ada 2 | *.adb diff=ada 3 | -------------------------------------------------------------------------------- /components/example/spec/.gitignore: -------------------------------------------------------------------------------- 1 | example.xml 2 | -------------------------------------------------------------------------------- /emulate/.gitignore: -------------------------------------------------------------------------------- 1 | .emulate 2 | *.iso 3 | *.out 4 | -------------------------------------------------------------------------------- /policy/platform/qemu-kvm-coreboot.xml: -------------------------------------------------------------------------------- 1 | qemu-kvm.xml -------------------------------------------------------------------------------- /policy/platform/intel-nuc-6cayh-efi.xml: -------------------------------------------------------------------------------- 1 | intel-nuc-6cayh.xml -------------------------------------------------------------------------------- /components/.gitignore: -------------------------------------------------------------------------------- 1 | .prepare-* 2 | */tests/*[-_]tests.ads 3 | -------------------------------------------------------------------------------- /policy/platform/up-squared-e3950-coreboot.xml: -------------------------------------------------------------------------------- 1 | up-squared-e3950.xml -------------------------------------------------------------------------------- /policy/scheduling/static/mirage-solo5.xml: -------------------------------------------------------------------------------- 1 | mirage-solo5-4-cpus.xml -------------------------------------------------------------------------------- /policy/scheduling/static/demo_system_vtd.xml: -------------------------------------------------------------------------------- 1 | demo_system_vtd-4-cpus.xml -------------------------------------------------------------------------------- /components/idle/spec/idle.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /policy/scheduling/static/integration_tests.xml: -------------------------------------------------------------------------------- 1 | integration_tests-4-cpus.xml -------------------------------------------------------------------------------- /policy/scheduling/static/mirage-solo5-lenovo-t430s.xml: -------------------------------------------------------------------------------- 1 | mirage-solo5-2-cpus.xml -------------------------------------------------------------------------------- /policy/scheduling/static/mirage-solo5-lenovo-t440s.xml: -------------------------------------------------------------------------------- 1 | mirage-solo5-2-cpus.xml -------------------------------------------------------------------------------- /policy/scheduling/static/mirage-solo5-lenovo-x260.xml: -------------------------------------------------------------------------------- 1 | mirage-solo5-2-cpus.xml -------------------------------------------------------------------------------- /components/sl/release/debug_ops.ads: -------------------------------------------------------------------------------- 1 | package Debug_Ops 2 | is 3 | end Debug_Ops; 4 | -------------------------------------------------------------------------------- /kernel/.gitignore: -------------------------------------------------------------------------------- 1 | .git-rev 2 | sk-version.ads 3 | *.cls 4 | *.jpg 5 | *.ttf 6 | -------------------------------------------------------------------------------- /policy/scheduling/static/demo_system_vtd-lenovo-t430s.xml: -------------------------------------------------------------------------------- 1 | demo_system_vtd-2-cpus.xml -------------------------------------------------------------------------------- /policy/scheduling/static/demo_system_vtd-lenovo-t440s.xml: -------------------------------------------------------------------------------- 1 | demo_system_vtd-2-cpus.xml -------------------------------------------------------------------------------- /policy/scheduling/static/demo_system_vtd-lenovo-x260.xml: -------------------------------------------------------------------------------- 1 | demo_system_vtd-2-cpus.xml -------------------------------------------------------------------------------- /policy/scheduling/static/integration_tests-qemu-kvm.xml: -------------------------------------------------------------------------------- 1 | integration_tests-2-cpus.xml -------------------------------------------------------------------------------- /policy/scheduling/static/mirage-solo5-intel-nuc-5i5myhe.xml: -------------------------------------------------------------------------------- 1 | mirage-solo5-2-cpus.xml -------------------------------------------------------------------------------- /policy/scheduling/static/mirage-solo5-qemu-kvm-efi.xml: -------------------------------------------------------------------------------- 1 | mirage-solo5-qemu-kvm.xml -------------------------------------------------------------------------------- /emulate/menu.lst: -------------------------------------------------------------------------------- 1 | timeout 0 2 | 3 | title Muen 4 | kernel hda0:/boot/kernel.csl 5 | -------------------------------------------------------------------------------- /policy/scheduling/static/demo_system_vtd-intel-nuc-5i5myhe.xml: -------------------------------------------------------------------------------- 1 | demo_system_vtd-2-cpus.xml -------------------------------------------------------------------------------- /policy/scheduling/static/demo_system_vtd-qemu-kvm-efi.xml: -------------------------------------------------------------------------------- 1 | demo_system_vtd-qemu-kvm.xml -------------------------------------------------------------------------------- /policy/scheduling/static/integration_tests-lenovo-t430s.xml: -------------------------------------------------------------------------------- 1 | integration_tests-2-cpus.xml -------------------------------------------------------------------------------- /policy/scheduling/static/integration_tests-lenovo-t440s.xml: -------------------------------------------------------------------------------- 1 | integration_tests-2-cpus.xml -------------------------------------------------------------------------------- /policy/scheduling/static/integration_tests-lenovo-x260.xml: -------------------------------------------------------------------------------- 1 | integration_tests-2-cpus.xml -------------------------------------------------------------------------------- /doc/images/muen.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codelabs-ch/muen/HEAD/doc/images/muen.pdf -------------------------------------------------------------------------------- /policy/scheduling/static/demo_system_vtd-qemu-kvm-coreboot.xml: -------------------------------------------------------------------------------- 1 | demo_system_vtd-qemu-kvm.xml -------------------------------------------------------------------------------- /policy/scheduling/static/integration_tests-intel-nuc-5i5myhe.xml: -------------------------------------------------------------------------------- 1 | integration_tests-2-cpus.xml -------------------------------------------------------------------------------- /policy/scheduling/static/integration_tests-intel-nuc-6cayh.xml: -------------------------------------------------------------------------------- 1 | integration_tests-4-cpus.xml -------------------------------------------------------------------------------- /policy/scheduling/static/integration_tests-qemu-kvm-efi.xml: -------------------------------------------------------------------------------- 1 | integration_tests-qemu-kvm.xml -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | bin 2 | lib 3 | obj 4 | generated 5 | .*.swp 6 | *~ 7 | *.pyc 8 | .clang-format 9 | -------------------------------------------------------------------------------- /components/example/.gitignore: -------------------------------------------------------------------------------- 1 | doc/* 2 | 3 | !doc/*.dot 4 | !doc/doc.xml.in 5 | !doc/bib.bib 6 | -------------------------------------------------------------------------------- /deploy/memdisk.tar.xz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codelabs-ch/muen/HEAD/deploy/memdisk.tar.xz -------------------------------------------------------------------------------- /doc/.gitignore: -------------------------------------------------------------------------------- 1 | *.aux 2 | *.lof 3 | *.log 4 | *.lol 5 | *.lot 6 | *.out 7 | *.pdf 8 | *.toc 9 | -------------------------------------------------------------------------------- /policy/scheduling/static/integration_tests-qemu-kvm-coreboot.xml: -------------------------------------------------------------------------------- 1 | integration_tests-qemu-kvm.xml -------------------------------------------------------------------------------- /emulate/keys/testkey.pub: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codelabs-ch/muen/HEAD/emulate/keys/testkey.pub -------------------------------------------------------------------------------- /policy/scheduling/static/integration_tests-intel-nuc-6cayh-efi.xml: -------------------------------------------------------------------------------- 1 | integration_tests-intel-nuc-6cayh.xml -------------------------------------------------------------------------------- /doc/report/images/muen.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codelabs-ch/muen/HEAD/doc/report/images/muen.pdf -------------------------------------------------------------------------------- /policy/xml/.gitignore: -------------------------------------------------------------------------------- 1 | demo_system_desktop_smp.xml 2 | mirage-solo5.xml 3 | mirageos/component_unikernel.xml 4 | -------------------------------------------------------------------------------- /doc/report/images/src/muen.svgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codelabs-ch/muen/HEAD/doc/report/images/src/muen.svgz -------------------------------------------------------------------------------- /components/example/doc/restart-event.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | ... 4 | 5 | -------------------------------------------------------------------------------- /components/libmutime/tests/src/libmutime_component.ads: -------------------------------------------------------------------------------- 1 | package Libmutime_Component 2 | is 3 | end Libmutime_Component; 4 | -------------------------------------------------------------------------------- /doc/report/lst_trap_table.tex: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /doc/articles/images/https-mirageos-muen.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codelabs-ch/muen/HEAD/doc/articles/images/https-mirageos-muen.jpg -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | Reto Buerki 2 | Robert Dorn, secunet AG 3 | Adrian-Ken Rueegsegger 4 | -------------------------------------------------------------------------------- /policy/xml/mirageos/_paths.py: -------------------------------------------------------------------------------- 1 | import sys 2 | from os.path import dirname 3 | 4 | sys.path.append(dirname(__file__) + "/../../../tools/libmupy") 5 | -------------------------------------------------------------------------------- /components/libmuinit/spec/libmuinit.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /components/linux/misc/_paths.py: -------------------------------------------------------------------------------- 1 | import sys 2 | from os.path import dirname 3 | 4 | sys.path.append(dirname(__file__) + "/../../../tools/libmupy") 5 | -------------------------------------------------------------------------------- /policy/xml/memory_ahci.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /components/isolation_tests/misc/_paths.py: -------------------------------------------------------------------------------- 1 | import sys 2 | from os.path import dirname 3 | 4 | sys.path.append(dirname(__file__) + "/../../../tools/libmupy") 5 | -------------------------------------------------------------------------------- /emulate/grub.cfg.efi: -------------------------------------------------------------------------------- 1 | set default=0 2 | set timeout=0 3 | 4 | menuentry "Muen Separation Kernel EFI" { 5 | sbs_init 6 | csl /boot/kernel.sbs 7 | boot 8 | } 9 | -------------------------------------------------------------------------------- /components/example/doc/bib.bib: -------------------------------------------------------------------------------- 1 | @book{muen:system-spec, 2 | title = {Muen System Specification}, 3 | author = {{Adrian-Ken Rueegsegger and Reto Buerki}}, 4 | } 5 | -------------------------------------------------------------------------------- /components/example/doc/subject-monitor-interrupts.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /components/example/doc/machine_attribute.ads: -------------------------------------------------------------------------------- 1 | pragma Machine_Attribute 2 | (Entity => $Subprogram_Name, 3 | Attribute_Name => "no_caller_saved_registers"); 4 | -------------------------------------------------------------------------------- /components/example/doc/restart-cspec.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | ... 6 | 7 | -------------------------------------------------------------------------------- /components/src/muenblock-request_channel-reader.ads: -------------------------------------------------------------------------------- 1 | with Muchannel.Readers; 2 | 3 | package Muenblock.Request_Channel.Reader is 4 | new Muenblock.Request_Channel.Readers; 5 | -------------------------------------------------------------------------------- /components/src/muenblock-response_channel-reader.ads: -------------------------------------------------------------------------------- 1 | with Muchannel.Readers; 2 | 3 | package Muenblock.Response_Channel.Reader is 4 | new Muenblock.Response_Channel.Readers; 5 | -------------------------------------------------------------------------------- /emulate/grub.cfg: -------------------------------------------------------------------------------- 1 | set default=0 2 | set timeout=0 3 | set debug=csl 4 | 5 | menuentry "Muen Separation Kernel" { 6 | sbs_init 7 | csl /boot/kernel.sbs 8 | boot 9 | } 10 | -------------------------------------------------------------------------------- /policy/xml/memory_xhci_dma.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /doc/report/lst_event_table.tex: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /deploy/args.sh: -------------------------------------------------------------------------------- 1 | declare -a ACTIONS=("start" "shutdown") 2 | 3 | case " ${ACTIONS[*]} " in 4 | *\ $ACTION\ *) 5 | ;; 6 | *) 7 | echo "Invalid action '$ACTION'" 8 | exit 1; 9 | esac 10 | -------------------------------------------------------------------------------- /doc/report/lst_spark.tex: -------------------------------------------------------------------------------- 1 | type Color_Type is (Red, Green, Blue); 2 | 3 | procedure Exchange (X, Y: in out Color_Type); 4 | --# derives X from Y & 5 | --# Y from X; 6 | --# post X = Y~ and Y = X~; 7 | -------------------------------------------------------------------------------- /components/libmutime/tests/src/libmutime_component-channels.ads: -------------------------------------------------------------------------------- 1 | package Libmutime_Component.Channels 2 | is 3 | 4 | Time_Info_Address : constant := 16#000f_ffd0_0000#; 5 | 6 | end Libmutime_Component.Channels; 7 | -------------------------------------------------------------------------------- /components/example/doc/sm_policy_trap.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | ... 5 | 6 | ... 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /components/libmutime/spec/libmutime.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /kernel/release/sk-kc.ads: -------------------------------------------------------------------------------- 1 | --D @Interface 2 | --D Kernel debug console implementation. 3 | --D Note: implementation is only present in debug builds. In release versions 4 | --D this package is empty. 5 | package SK.KC 6 | is 7 | end SK.KC; 8 | -------------------------------------------------------------------------------- /components/src/muenblock-request_channel-writer_instance.ads: -------------------------------------------------------------------------------- 1 | with Muchannel.Writer; 2 | 3 | pragma Elaborate_All (Muchannel.Writer); 4 | 5 | package Muenblock.Request_Channel.Writer_Instance is 6 | new Muenblock.Request_Channel.Writer; 7 | -------------------------------------------------------------------------------- /components/src/muenblock-response_channel-writer_instance.ads: -------------------------------------------------------------------------------- 1 | with Muchannel.Writer; 2 | 3 | pragma Elaborate_All (Muchannel.Writer); 4 | 5 | package Muenblock.Response_Channel.Writer_Instance is 6 | new Muenblock.Response_Channel.Writer; 7 | -------------------------------------------------------------------------------- /kernel/release/sk-dump.ads: -------------------------------------------------------------------------------- 1 | --D @Interface 2 | --D Utility package providing helper functions for printing debug information. 3 | --D Note: implementation is only present in debug builds. In release versions 4 | --D this package is empty. 5 | package SK.Dump 6 | is 7 | end SK.Dump; 8 | -------------------------------------------------------------------------------- /deploy/boot.cfg: -------------------------------------------------------------------------------- 1 | #!ipxe 2 | 3 | kernel http://192.168.254.1:8000/memdisk || goto failed 4 | initrd http://192.168.254.1:8000/muen.iso || goto failed 5 | imgargs memdisk iso raw || goto failed 6 | boot 7 | 8 | :failed 9 | echo Unable to load image, bailing out 10 | read void 11 | -------------------------------------------------------------------------------- /components/libmudebuglog/spec/libmudebuglog.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /doc/report/.gitignore: -------------------------------------------------------------------------------- 1 | *.aux 2 | *.blg 3 | *.bbl 4 | *.idx 5 | *.ilg 6 | *.ind 7 | *.lof 8 | *.log 9 | *.lol 10 | *.lot 11 | *.nav 12 | *.pdf 13 | *.out 14 | *.snm 15 | *.toc 16 | *.vrb 17 | binary.tex 18 | hardware.tex 19 | kernel.tex 20 | scheduling.tex 21 | subject.tex 22 | types.tex 23 | -------------------------------------------------------------------------------- /kernel/spark/sk-vtd-dump.ads: -------------------------------------------------------------------------------- 1 | --D @Interface 2 | --D Utility package providing helper functions for printing VT-d debug 3 | --D information. 4 | --D Note: implementation is only present in debug builds. In release versions 5 | --D this package is empty. 6 | package SK.VTd.Dump 7 | is 8 | end SK.VTd.Dump; 9 | -------------------------------------------------------------------------------- /kernel/release/sk-vtd-dump.ads: -------------------------------------------------------------------------------- 1 | --D @Interface 2 | --D Utility package providing helper functions for printing VT-d debug 3 | --D information. 4 | --D Note: implementation is only present in debug builds. In release versions 5 | --D this package is empty. 6 | package SK.VTd.Dump 7 | is 8 | end SK.VTd.Dump; 9 | -------------------------------------------------------------------------------- /doc/report/graph_object_analysis.tex: -------------------------------------------------------------------------------- 1 | \begin{tikzpicture} 2 | \node (obj) [bluebox] {Binary object}; 3 | \node (skc) [apribox, below=of obj] {skconfig}; 4 | \node (xml) [greenbox, below=of skc] {XML specification}; 5 | 6 | \draw[arrow] (obj) to (skc); 7 | \draw[arrow] (skc) to (xml); 8 | \end{tikzpicture} 9 | -------------------------------------------------------------------------------- /doc/report/graph_vmm_type1.tex: -------------------------------------------------------------------------------- 1 | \begin{tikzpicture}[text width=2cm, minimum height=0.5cm] 2 | \node (haw) [apribox] {Hardware}; 3 | \node (vmm) [bluebox, above=0.1cm of haw] {VMM}; 4 | \node (vim) [greenbox, above=of vmm] {Virtual Machine}; 5 | 6 | \draw[arrow] (vmm) to (vim); 7 | \end{tikzpicture} 8 | -------------------------------------------------------------------------------- /components/libmudm/spec/libmudm.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /kernel/release/sk-subjects-debug.ads: -------------------------------------------------------------------------------- 1 | --D @Interface 2 | --D Utility package providing helper function for printing subject state debug 3 | --D information. 4 | --D Note: implementation is only present in debug builds. In release versions 5 | --D this package is empty. 6 | package SK.Subjects.Debug 7 | is 8 | end SK.Subjects.Debug; 9 | -------------------------------------------------------------------------------- /components/example/doc/restart-memory.xml: -------------------------------------------------------------------------------- 1 | ... 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | ... 12 | -------------------------------------------------------------------------------- /components/src/muenblock-request_channel.ads: -------------------------------------------------------------------------------- 1 | with Muchannel; 2 | 3 | pragma Elaborate_All (Muchannel); 4 | 5 | package Muenblock.Request_Channel is new Muchannel 6 | (Element_Type => Block_Request_Type, 7 | Elements => Request_Channel_Elements, 8 | Null_Element => Null_Request, 9 | Protocol => Protocol); 10 | -------------------------------------------------------------------------------- /components/dm/spec/dm.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /components/src/muenblock-response_channel.ads: -------------------------------------------------------------------------------- 1 | with Muchannel; 2 | 3 | pragma Elaborate_All (Muchannel); 4 | 5 | package Muenblock.Response_Channel is new Muchannel 6 | (Element_Type => Block_Response_Type, 7 | Elements => Response_Channel_Elements, 8 | Null_Element => Null_Response, 9 | Protocol => Protocol); 10 | -------------------------------------------------------------------------------- /deploy/lighttpd.conf: -------------------------------------------------------------------------------- 1 | server.modules += ( 2 | "mod_accesslog", 3 | "mod_dirlisting", 4 | "mod_staticfile", 5 | ) 6 | 7 | server.document-root = "HTTP_DIR" 8 | server.errorlog = "HTTP_DIR/lighttpd.log" 9 | server.breakagelog = "HTTP_DIR/error.log" 10 | accesslog.filename = "HTTP_DIR/http.log" 11 | server.port = DEPLOY_PORT 12 | -------------------------------------------------------------------------------- /doc/report/scripts/svg_remove_link_img.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Strip linked images from UML type SVG files. 4 | 5 | FILES=*.svg 6 | 7 | for f in $FILES 8 | do 9 | echo Processing $f 10 | inkscape --file=$f --export-area-drawing --without-gui --export-plain-svg=$f 11 | sed -i '//d' $f 12 | sed -i '//d' $f 13 | done 14 | -------------------------------------------------------------------------------- /kernel/release/sk-vtd-debug.ads: -------------------------------------------------------------------------------- 1 | --D @Interface 2 | --D Utility package providing debug functions for setting up and handling VT-d 3 | --D fault interrupts, i.e. printing VT-d fault debug information. 4 | --D Note: implementation is only present in debug builds. In release versions 5 | --D this package is empty. 6 | package SK.VTd.Debug 7 | is 8 | end SK.VTd.Debug; 9 | -------------------------------------------------------------------------------- /components/sl/spec/sl.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /doc/report/graph_vmm_type2.tex: -------------------------------------------------------------------------------- 1 | \begin{tikzpicture}[text width=2cm, minimum height=0.5cm] 2 | \node (haw) [apribox] {Hardware}; 3 | \node (hos) [apribox, above=0.1cm of haw] {Hosting OS}; 4 | \node (vmm) [bluebox, above=0.1cm of hos] {VMM}; 5 | \node (vim) [greenbox, above=of vmm] {Virtual Machine}; 6 | 7 | \draw[arrow] (vmm) to (vim); 8 | \end{tikzpicture} 9 | -------------------------------------------------------------------------------- /.arcconfig: -------------------------------------------------------------------------------- 1 | { 2 | "project_id" : "Muen Separation Kernel", 3 | "conduit_uri" : "https://dev.codelabs.ch/", 4 | "git.default-relative-commit" : "origin/devel", 5 | "arc.land.onto" : [ "devel" ], 6 | "arc.land.onto.default" : "devel", 7 | "arc.land.strategy" : "merge", 8 | "unit.engine" : "GNATtestEngineBob", 9 | "repository.callsign" : "M", 10 | "history.immutable" : true 11 | } 12 | -------------------------------------------------------------------------------- /components/libmucontrol/spec/libmucontrol.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /doc/report/standalone_image.tex: -------------------------------------------------------------------------------- 1 | % Compile with: pdflatex -shell-escape standalone_image 2 | 3 | \PassOptionsToPackage{dvipsnames}{xcolor} 4 | \documentclass[tikz,border=2.5pt,convert={size=2048,outext=.png}]{standalone} 5 | \usetikzlibrary{backgrounds,positioning,shapes,shadows,arrows,fit,decorations.markings} 6 | 7 | \begin{document} 8 | \input{tikzstyle} 9 | \include{graph_mp_overview} 10 | \end{document} 11 | -------------------------------------------------------------------------------- /components/linux/spec/linux.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /kernel/src/asm/gdt.h: -------------------------------------------------------------------------------- 1 | // segment descriptors: See Intel SDM Vol. 3A, "3.4.5 Segment Descriptors" 2 | 3 | #define GDTE_TYPE_DATA_W (1 << 9) 4 | #define GDTE_CODE (1 << 11) 5 | #define GDTE_NON_SYSTEM (1 << 12) 6 | #define GDTE_PRESENT (1 << 15) 7 | #define GDTE_LONG (1 << 21) 8 | #define GDTE_32BIT (1 << 22) 9 | #define GDTE_GRANULAR_4K (1 << 23) 10 | 11 | #define GDTE_SYS_TSS 0x900 12 | 13 | #define AP_KERN_CS 0x8 14 | #define AP_KERN_DS 0x10 15 | -------------------------------------------------------------------------------- /doc/report/graph_arch_overview.tex: -------------------------------------------------------------------------------- 1 | \begin{tikzpicture} 2 | \node[bluebox, minimum height=1cm, text width=5cm] (mue) {Muen Separation Kernel}; 3 | \node[greenbox, minimum height=2cm, text width=2cm, above=of mue.north west, anchor=south west] (nat) {Native Subject}; 4 | \node[greenbox, minimum height=2cm, text width=2cm, above=of mue.north east, anchor=south east] (vim) {VM Subject}; 5 | \draw[gray] (-2.6,0.5) to (2.6,0.5); 6 | \draw[gray] (0,0.5) to (0,3); 7 | \end{tikzpicture} 8 | -------------------------------------------------------------------------------- /components/example/src/blkwrite/disabled/muenblock_example-write_ops.adb: -------------------------------------------------------------------------------- 1 | package body Muenblock_Example.Write_Ops 2 | is 3 | 4 | ------------------------------------------------------------------------- 5 | 6 | procedure Run 7 | (Sector_Size : Interfaces.Unsigned_64; 8 | Success : out Boolean) 9 | is 10 | pragma Unreferenced (Sector_Size); 11 | begin 12 | Success := True; 13 | end Run; 14 | 15 | end Muenblock_Example.Write_Ops; 16 | -------------------------------------------------------------------------------- /components/example/src/muenblock_example-write_ops.ads: -------------------------------------------------------------------------------- 1 | with Interfaces; 2 | 3 | with Musinfo.Instance; 4 | 5 | private package Muenblock_Example.Write_Ops 6 | is 7 | use type Interfaces.Unsigned_64; 8 | 9 | -- Perform write operations (for CI). 10 | procedure Run 11 | (Sector_Size : Interfaces.Unsigned_64; 12 | Success : out Boolean) 13 | with 14 | Pre => Musinfo.Instance.Is_Valid and Sector_Size > 0; 15 | 16 | end Muenblock_Example.Write_Ops; 17 | -------------------------------------------------------------------------------- /policy/xml/subject_dbgserver_genode.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /components/isolation_tests_monitor/spec/isolation_tests_monitor.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /.arclint: -------------------------------------------------------------------------------- 1 | { 2 | "linters": { 3 | "spelling": { 4 | "type": "spelling" 5 | }, 6 | 7 | "sdmref": { 8 | "type": "script-and-regex", 9 | "exclude": "(^doc/report/)", 10 | "include": [ 11 | "(\\.ad[bs]$)", 12 | "(\\.[chS]$)", 13 | "(\\.xml$)", 14 | "(\\.xsd$)"], 15 | "script-and-regex.script": "/opt/sdmref/sdmref -i", 16 | "script-and-regex.regex": "/^(?P.*)$/m" 17 | }, 18 | 19 | "black": { 20 | "type": "black", 21 | "include": "(\\.py$)" 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /components/example/doc/restart-subject.xml: -------------------------------------------------------------------------------- 1 | 2 | ... 3 | 4 | 5 | 6 | 7 | 8 | ... 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /doc/report/graph_init_mem_layout_example.tex: -------------------------------------------------------------------------------- 1 | \begin{bytefield}{24} 2 | \bitbox[]{10}{} 3 | \bitbox[]{16}{$\vdots$}\\[1ex] 4 | \memsection{0010 0000}{0020 3fff}{6}{Kernel memory}\\ 5 | \memsection{0000 8000}{000f ffff}{3}{\color{Gray}-- free --}\\ 6 | \begin{rightwordgroup}{VMX regions} 7 | \memsection{0000 5000}{0000 7fff}{2}{\color{Red}VMCS}\\ 8 | \memsection{0000 1000}{0000 4fff}{2}{\color{Red}VMXON} 9 | \end{rightwordgroup}\\ 10 | \memsection{0000 0000}{0000 0fff}{2}{\color{Red}AP trampoline} 11 | \end{bytefield} 12 | -------------------------------------------------------------------------------- /components/muinit/spec/muinit.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 16#0010_0000# 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /policy/xml/subject_its.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /policy/xml/common_expressions.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /deploy/start_shutdown_egctl.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Start or stop target host given as first argument using the egctl 4 | # tool [1] 5 | # 6 | # [1] - https://github.com/unterwulf/egctl 7 | 8 | DEVICE=$1 9 | ACTION=$2 10 | EGCTL=egctl 11 | ONSOCKET="on left left left" 12 | OFFSOCKET="off left left left" 13 | 14 | if [ "$#" -ne 2 ]; then 15 | echo "$0 " 16 | exit 2 17 | fi 18 | 19 | SCRIPTDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 20 | 21 | source $SCRIPTDIR/args.sh 22 | 23 | case $ACTION in 24 | start) 25 | $EGCTL $DEVICE $ONSOCKET 26 | ;; 27 | shutdown) 28 | $EGCTL $DEVICE $OFFSOCKET 29 | ;; 30 | esac 31 | -------------------------------------------------------------------------------- /doc/report/graph_policy_compilation.tex: -------------------------------------------------------------------------------- 1 | \begin{tikzpicture} 2 | \node (pol) [greenbox] {Policy}; 3 | \node (skp) [apribox, below=of pol] {skpolicy}; 4 | \node (sou) [bluebox, below=of skp, xshift=1.5cm] {Source specs}; 5 | \node (pag) [bluebox, left=of sou] {Page tables}; 6 | \node (iob) [bluebox, left=of pag] {I/O bitmaps}; 7 | \node (msr) [bluebox, right=of sou] {MSR bitmaps}; 8 | 9 | \draw[arrow] (pol) to (skp); 10 | \draw[arrow] (skp) to (sou); 11 | \draw[arrow] (skp) to (msr); 12 | \draw[arrow] (skp) to (pag); 13 | \draw[arrow] (skp) to (iob); 14 | \end{tikzpicture} 15 | -------------------------------------------------------------------------------- /policy/xml/subject_nic_sl.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /components/libmutime/tests/mutime-test_data.ads: -------------------------------------------------------------------------------- 1 | -- This package is intended to set up and tear down the test environment. 2 | -- Once created by GNATtest, this package will never be overwritten 3 | -- automatically. Contents of this package can be modified in any way 4 | -- except for sections surrounded by a 'read only' marker. 5 | 6 | with AUnit.Test_Fixtures; 7 | 8 | package Mutime.Test_Data is 9 | 10 | -- begin read only 11 | type Test is new AUnit.Test_Fixtures.Test_Fixture 12 | -- end read only 13 | with null record; 14 | 15 | procedure Set_Up (Gnattest_T : in out Test); 16 | procedure Tear_Down (Gnattest_T : in out Test); 17 | 18 | end Mutime.Test_Data; 19 | -------------------------------------------------------------------------------- /doc/report/graph_major_frame.tex: -------------------------------------------------------------------------------- 1 | \begin{ganttchart}[ 2 | vgrid={*3{dotted},*1{dashed},*7{dotted},*1{dashed},*3{dotted},*1{dashed},*3{dotted}}, 3 | hgrid, 4 | y unit title=0.75cm, 5 | title label anchor/.style={below=-1.5ex}]{1}{20} 6 | \gantttitle{Major frame}{20} \\ 7 | \gantttitle{Minor 1}{4} 8 | \gantttitle{Minor 2}{8} 9 | \gantttitle{Minor 3}{4} 10 | \gantttitle{Minor 4}{4} \\ 11 | \ganttbar[bar/.append style={fill=CornflowerBlue}]{Subject 1}{1}{4} 12 | \ganttbar[bar/.append style={fill=CornflowerBlue}]{}{13}{16} \\ 13 | \ganttbar[bar/.append style={fill=YellowGreen}]{Subject 2}{5}{12} 14 | \ganttbar[bar/.append style={fill=YellowGreen}]{}{17}{20} 15 | \end{ganttchart} 16 | -------------------------------------------------------------------------------- /components/libmutime/tests/mutime-info-test_data.ads: -------------------------------------------------------------------------------- 1 | -- This package is intended to set up and tear down the test environment. 2 | -- Once created by GNATtest, this package will never be overwritten 3 | -- automatically. Contents of this package can be modified in any way 4 | -- except for sections surrounded by a 'read only' marker. 5 | 6 | with AUnit.Test_Fixtures; 7 | 8 | package Mutime.Info.Test_Data is 9 | 10 | -- begin read only 11 | type Test is new AUnit.Test_Fixtures.Test_Fixture 12 | -- end read only 13 | with null record; 14 | 15 | procedure Set_Up (Gnattest_T : in out Test); 16 | procedure Tear_Down (Gnattest_T : in out Test); 17 | 18 | end Mutime.Info.Test_Data; 19 | -------------------------------------------------------------------------------- /components/libmusinfo/tests/musinfo-utils-test_data.ads: -------------------------------------------------------------------------------- 1 | -- This package is intended to set up and tear down the test environment. 2 | -- Once created by GNATtest, this package will never be overwritten 3 | -- automatically. Contents of this package can be modified in any way 4 | -- except for sections surrounded by a 'read only' marker. 5 | 6 | with AUnit.Test_Fixtures; 7 | 8 | package Musinfo.Utils.Test_Data is 9 | 10 | -- begin read only 11 | type Test is new AUnit.Test_Fixtures.Test_Fixture 12 | -- end read only 13 | with null record; 14 | 15 | procedure Set_Up (Gnattest_T : in out Test); 16 | procedure Tear_Down (Gnattest_T : in out Test); 17 | 18 | end Musinfo.Utils.Test_Data; 19 | -------------------------------------------------------------------------------- /components/libmutime/tests/mutime-utils-test_data.ads: -------------------------------------------------------------------------------- 1 | -- This package is intended to set up and tear down the test environment. 2 | -- Once created by GNATtest, this package will never be overwritten 3 | -- automatically. Contents of this package can be modified in any way 4 | -- except for sections surrounded by a 'read only' marker. 5 | 6 | with AUnit.Test_Fixtures; 7 | 8 | package Mutime.Utils.Test_Data is 9 | 10 | -- begin read only 11 | type Test is new AUnit.Test_Fixtures.Test_Fixture 12 | -- end read only 13 | with null record; 14 | 15 | procedure Set_Up (Gnattest_T : in out Test); 16 | procedure Tear_Down (Gnattest_T : in out Test); 17 | 18 | end Mutime.Utils.Test_Data; 19 | -------------------------------------------------------------------------------- /components/time/spec/time.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 0 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /deploy/start_shutdown_epc.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Start or stop target host using the GUDE Expert Power Control (EPC) NET power 4 | # connector [1]. The target is assumed to be plugged in port 1. 5 | # 6 | # [1] - http://wiki.gude.info/FAQ_EPC_CmdLine#Beispiele 7 | 8 | DEVICE=$1 9 | ACTION=$2 10 | WGET="wget --quiet --delete-after" 11 | URL="http://$DEVICE/ov.html?cmd=1&p=1&s=" 12 | 13 | if [ "$#" -ne 2 ]; then 14 | echo "$0 " 15 | exit 2 16 | fi 17 | 18 | SCRIPTDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 19 | 20 | source $SCRIPTDIR/args.sh 21 | 22 | case $ACTION in 23 | start) 24 | $WGET "${URL}1" 25 | ;; 26 | shutdown) 27 | $WGET "${URL}0" 28 | ;; 29 | esac 30 | -------------------------------------------------------------------------------- /policy/xml/subject_itsm.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /doc/report/graph_external_interrupt.tex: -------------------------------------------------------------------------------- 1 | \begin{tikzpicture} 2 | \node[graybox] (han) {\textbf{3} Handle IRQ}; 3 | \node[above=2mm of han] (mue) {Muen SK}; 4 | 5 | \begin{pgfonlayer}{background} 6 | \node[bluebox, minimum width=3cm, minimum height=1.7cm] (mub) [fit = (han) (mue)] {}; 7 | \end{pgfonlayer} 8 | 9 | \node[greenbox, minimum width=3cm, minimum height=1.7cm, above=of mub] (sub) {Subject}; 10 | \node[apribox, left=15mm of mub] (irq) {Device}; 11 | 12 | \draw[arrow] (irq) to node[auto] {\textbf{1} IRQ} (mub); 13 | \draw[arrow] (sub.225) to node[auto, swap] {\textbf{2} VM exit} (mub.135); 14 | \draw[arrow] (mub.45) to node[auto, swap] {\textbf{4} Inject event} (sub.315); 15 | \end{tikzpicture} 16 | -------------------------------------------------------------------------------- /doc/report/graph_scheduler.tex: -------------------------------------------------------------------------------- 1 | \begin{tikzpicture}[minimum height=0.6cm] 2 | \node (sch) [bluebox] {Scheduler}; 3 | \node (knl) [bluebox, left=of sch] {Kernel Main}; 4 | \node (pln) [apribox, above=of sch] {Scheduling Plan}; 5 | \node (sub) [greenbox, right=of sch] {Subject}; 6 | \node[gray, font=\scriptsize] at (0.8,2.3) {VMX root}; 7 | \node[gray, font=\scriptsize] at (2.6,2.3) {VMX non-root}; 8 | 9 | \draw[arrow] (knl) to (sch); 10 | \draw[arrow] (pln) to (sch); 11 | \draw[arrow] (sch) to[bend right=65] node[auto] {VM enter} (sub); 12 | \draw[arrow] (sub) to[bend right=65] node[auto] {VM exit} (sch); 13 | \draw[thin, dotted, gray] (1.6,-1.5) to (1.6,2.5); 14 | \end{tikzpicture} 15 | -------------------------------------------------------------------------------- /components/libmutime/tests/mutime-test_data.adb: -------------------------------------------------------------------------------- 1 | -- This package is intended to set up and tear down the test environment. 2 | -- Once created by GNATtest, this package will never be overwritten 3 | -- automatically. Contents of this package can be modified in any way 4 | -- except for sections surrounded by a 'read only' marker. 5 | 6 | package body Mutime.Test_Data is 7 | 8 | procedure Set_Up (Gnattest_T : in out Test) is 9 | pragma Unreferenced (Gnattest_T); 10 | begin 11 | null; 12 | end Set_Up; 13 | 14 | procedure Tear_Down (Gnattest_T : in out Test) is 15 | pragma Unreferenced (Gnattest_T); 16 | begin 17 | null; 18 | end Tear_Down; 19 | 20 | end Mutime.Test_Data; 21 | -------------------------------------------------------------------------------- /components/libmudebuglog/misc/config.xsl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /components/libmutime/tests/mutime-info-test_data.adb: -------------------------------------------------------------------------------- 1 | -- This package is intended to set up and tear down the test environment. 2 | -- Once created by GNATtest, this package will never be overwritten 3 | -- automatically. Contents of this package can be modified in any way 4 | -- except for sections surrounded by a 'read only' marker. 5 | 6 | package body Mutime.Info.Test_Data is 7 | 8 | procedure Set_Up (Gnattest_T : in out Test) is 9 | pragma Unreferenced (Gnattest_T); 10 | begin 11 | null; 12 | end Set_Up; 13 | 14 | procedure Tear_Down (Gnattest_T : in out Test) is 15 | pragma Unreferenced (Gnattest_T); 16 | begin 17 | null; 18 | end Tear_Down; 19 | 20 | end Mutime.Info.Test_Data; 21 | -------------------------------------------------------------------------------- /components/libmusinfo/tests/musinfo-utils-test_data.adb: -------------------------------------------------------------------------------- 1 | -- This package is intended to set up and tear down the test environment. 2 | -- Once created by GNATtest, this package will never be overwritten 3 | -- automatically. Contents of this package can be modified in any way 4 | -- except for sections surrounded by a 'read only' marker. 5 | 6 | package body Musinfo.Utils.Test_Data is 7 | 8 | procedure Set_Up (Gnattest_T : in out Test) is 9 | pragma Unreferenced (Gnattest_T); 10 | begin 11 | null; 12 | end Set_Up; 13 | 14 | procedure Tear_Down (Gnattest_T : in out Test) is 15 | pragma Unreferenced (Gnattest_T); 16 | begin 17 | null; 18 | end Tear_Down; 19 | 20 | end Musinfo.Utils.Test_Data; 21 | -------------------------------------------------------------------------------- /components/libmutime/tests/mutime-utils-test_data.adb: -------------------------------------------------------------------------------- 1 | -- This package is intended to set up and tear down the test environment. 2 | -- Once created by GNATtest, this package will never be overwritten 3 | -- automatically. Contents of this package can be modified in any way 4 | -- except for sections surrounded by a 'read only' marker. 5 | 6 | package body Mutime.Utils.Test_Data is 7 | 8 | procedure Set_Up (Gnattest_T : in out Test) is 9 | pragma Unreferenced (Gnattest_T); 10 | begin 11 | null; 12 | end Set_Up; 13 | 14 | procedure Tear_Down (Gnattest_T : in out Test) is 15 | pragma Unreferenced (Gnattest_T); 16 | begin 17 | null; 18 | end Tear_Down; 19 | 20 | end Mutime.Utils.Test_Data; 21 | -------------------------------------------------------------------------------- /policy/xml/subject_nic_dm.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /kernel/doc/graph_major_frame.tex: -------------------------------------------------------------------------------- 1 | \begin{ganttchart}[ 2 | vgrid={*3{dotted},*1{dashed},*7{dotted},*1{dashed},*3{dotted},*1{dashed},*3{dotted}}, 3 | hgrid, 4 | y unit title=0.75cm, 5 | title label anchor/.style={below=-1.5ex}]{1}{20} 6 | \gantttitle{Major frame}{20} \\ 7 | \gantttitle{Minor 1}{4} 8 | \gantttitle{Minor 2}{8} 9 | \gantttitle{Minor 3}{4} 10 | \gantttitle{Minor 4}{4} \\ 11 | \ganttbar[bar/.append style={top color=white, bottom color=usercolor}]{Partition 1}{1}{4} 12 | \ganttbar[bar/.append style={top color=white, bottom color=usercolor}]{}{13}{16} \\ 13 | \ganttbar[bar/.append style={top color=white, bottom color=guestcolor}]{Partition 2}{5}{12} 14 | \ganttbar[bar/.append style={top color=white, bottom color=guestcolor}]{}{17}{20} 15 | \end{ganttchart} 16 | -------------------------------------------------------------------------------- /doc/report/graph_image_packaging.tex: -------------------------------------------------------------------------------- 1 | \begin{tikzpicture} 2 | \node (knl) [bluebox] {Kernel binary}; 3 | \node (sub) [bluebox, left=of knl] {Subject binaries}; 4 | \node (pag) [bluebox, left=of sub] {Page tables}; 5 | \node (bit) [bluebox, right=of knl] {Bitmaps}; 6 | \node (skp) [apribox, below=of knl, xshift=-1.5cm] {skpacker}; 7 | \node (spe) [bluebox, left=of skp] {Packer spec}; 8 | \node (sys) [greenbox, below=of skp] {System image}; 9 | 10 | \draw[arrow] (pag) to (skp); 11 | \draw[arrow] (sub) to (skp); 12 | \draw[arrow] (knl) to (skp); 13 | \draw[arrow] (bit) to (skp); 14 | \draw[arrow] (skp) to (sys); 15 | \draw[arrow] (spe) to (skp); 16 | \end{tikzpicture} 17 | -------------------------------------------------------------------------------- /kernel/doc/graph_scheduling_entities.tex: -------------------------------------------------------------------------------- 1 | \begin{tikzpicture}[minimum height=0.6cm] 2 | \node (pln) [commonnode, bottom color=dark-gray, minimum width=1cm] {Scheduling Plan}; 3 | \node (prt) [commonnode, below=of pln, bottom color=kernelcolor, align=center] {Scheduling Partition [non-cooperative scheduling]}; 4 | \node (grp) [commonnode, below=of prt, bottom color=guestcolor, align=center] {Scheduling Group [cooperative scheduling]}; 5 | \node (sub) [commonnode, below=of grp, bottom color=usercolor] {Subject}; 6 | 7 | \draw[-] (pln) to node[pos=0.2, right]{\(n\)} node[pos=0.8, right]{\(m\)} (prt); 8 | \draw[-] (prt) to node[pos=0.2, right]{1} node[pos=0.8, right]{\(n\)} (grp); 9 | \draw[-] (grp) to node[pos=0.2, right]{1} node[pos=0.8, right]{\(n\)} (sub); 10 | \end{tikzpicture} 11 | -------------------------------------------------------------------------------- /doc/report/graph_build_process.tex: -------------------------------------------------------------------------------- 1 | \begin{tikzpicture}[minimum width=2.5cm, minimum height=0.6cm] 2 | \node (too) [apribox] {Build tools}; 3 | \node (rts) [apribox, right=of too] {Build RTS}; 4 | \node (pol) [apribox, below=of too] {Compile policy}; 5 | \node (knl) [bluebox, right=of pol] {Build Kernel}; 6 | \node (sub) [apribox, right=of knl] {Build Subjects}; 7 | \node (pak) [apribox, below=of knl] {Package Image}; 8 | \node (img) [greenbox, below=of pak] {OS image}; 9 | 10 | \draw[arrow] (too) -- (pol); 11 | \draw[arrow] (rts) -- (knl); 12 | \draw[arrow] (rts) -| (sub); 13 | \draw[arrow] (pol) -- (knl); 14 | \draw[arrow] (pol) |- (pak); 15 | \draw[arrow] (knl) -- (pak); 16 | \draw[arrow] (sub) |- (pak); 17 | \draw[arrow] (pak) -- (img); 18 | \end{tikzpicture} 19 | -------------------------------------------------------------------------------- /doc/report/graph_vmm_lifecycle.tex: -------------------------------------------------------------------------------- 1 | \begin{tikzpicture} 2 | \node[bluebox] (vmm) {VMM}; 3 | \node[left=2.2cm of vmm] (du1) {}; 4 | \node[right=2.2cm of vmm] (du2) {}; 5 | \node[gray, font=\scriptsize, above=2.2cm of vmm] (du3) {VMX non-root}; 6 | 7 | \node[gray, font=\scriptsize, below=2mm of vmm] {VMX root}; 8 | 9 | \node[greenbox, left=3mm of du3] (gu0) {Guest 0}; 10 | \node[greenbox, right=2mm of du3] (gu1) {Guest 1}; 11 | 12 | \draw[arrow] (du1) to node[auto] {VMXON} (vmm); 13 | \draw[arrow] (vmm) to node[auto] {VMXOFF} (du2); 14 | 15 | \draw[arrow] (vmm) to node[right] {VM Entry} (gu0); 16 | \draw[arrow] (gu0) to[bend right] node[left] {VM Exit} (vmm); 17 | \draw[arrow] (vmm) to (gu1); 18 | \draw[arrow] (gu1) to[bend left] node[right] {VM Exit} (vmm); 19 | \end{tikzpicture} 20 | -------------------------------------------------------------------------------- /doc/report/tikzstyle.tex: -------------------------------------------------------------------------------- 1 | \tikzstyle{commonbox}=[rectangle, draw=black, rounded corners, text centered, 2 | anchor=north] 3 | \tikzstyle{graybox}=[commonbox, fill=Gray!20] 4 | \tikzstyle{shadowbox}=[commonbox, drop shadow] 5 | \tikzstyle{greenbox}=[shadowbox, fill=YellowGreen!50] 6 | \tikzstyle{apribox}=[shadowbox, fill=Apricot!50] 7 | \tikzstyle{bluebox}=[shadowbox, fill=CornflowerBlue!50] 8 | \tikzstyle{redbox}=[shadowbox, fill=Red!50] 9 | \tikzstyle{blackbox}=[shadowbox, fill=Black!65, text=White] 10 | \tikzstyle{arrow}=[->, thick] 11 | \tikzstyle{vecarrow}=[thick, decoration={markings,mark=at position 12 | 1 with {\arrow[semithick]{open triangle 60}}}, 13 | double distance=1.4pt, shorten >= 5.5pt, 14 | preaction={decorate}, 15 | postaction={draw, line width=1.4pt, white,shorten >= 4.5pt}] 16 | -------------------------------------------------------------------------------- /doc/toolchain/tikzstyle.tex: -------------------------------------------------------------------------------- 1 | \tikzstyle{commonbox}=[rectangle, draw=black, rounded corners, text centered, 2 | anchor=north] 3 | \tikzstyle{graybox}=[commonbox, fill=Gray!20] 4 | \tikzstyle{shadowbox}=[commonbox, drop shadow] 5 | \tikzstyle{greenbox}=[shadowbox, fill=YellowGreen!50] 6 | \tikzstyle{apribox}=[shadowbox, fill=Apricot!50] 7 | \tikzstyle{bluebox}=[shadowbox, fill=CornflowerBlue!50] 8 | \tikzstyle{redbox}=[shadowbox, fill=Red!50] 9 | \tikzstyle{blackbox}=[shadowbox, fill=Black!65, text=White] 10 | \tikzstyle{arrow}=[->, thick] 11 | \tikzstyle{vecarrow}=[thick, decoration={markings,mark=at position 12 | 1 with {\arrow[semithick]{open triangle 60}}}, 13 | double distance=1.4pt, shorten >= 5.5pt, 14 | preaction={decorate}, 15 | postaction={draw, line width=1.4pt, white,shorten >= 4.5pt}] 16 | -------------------------------------------------------------------------------- /doc/report/graph_address_translation.tex: -------------------------------------------------------------------------------- 1 | \begin{tikzpicture}[minimum height=0.6cm] 2 | \node[bluebox] (pti) {Index}; 3 | \node[bluebox, minimum width=3cm, right=1mm of pti] (ofs) {Offset}; 4 | \node[above=1mm of ofs, xshift=-0.5cm] (via) {Virtual address}; 5 | 6 | \node[greenbox, minimum width=3.2cm, minimum height=1.5cm, label={[yshift=-18pt]Page table}, below=of ofs] (pta) {}; 7 | \node[graybox] (pte) at (pta.south) [above=5pt] {Page table entry}; 8 | 9 | \node[apribox, minimum width=3.2cm, minimum height=1.5cm, label={[yshift=-18pt]Page frame}, right=of pta, xshift=-0.5cm, yshift=1.5cm] (php) {}; 10 | \node[graybox] (paf) at (php.south) [above=5pt] {Physical address}; 11 | 12 | \draw[arrow] (pti) |- (pte); 13 | \draw[arrow] (ofs) |- (paf); 14 | \draw[arrow] (pte) -| (php); 15 | \end{tikzpicture} 16 | -------------------------------------------------------------------------------- /components/sm/misc/gpr.xsl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /doc/report/graph_arch_example.tex: -------------------------------------------------------------------------------- 1 | \begin{tikzpicture}[node distance=0.33cm] 2 | \node[redbox, text width=1.5cm, minimum width=2cm, minimum height=2cm] (vts) {VT Native}; 3 | \node[redbox, text width=1.5cm, minimum width=2cm, minimum height=2cm, left=of vts] (cry) {Crypter Native}; 4 | \node[redbox, text width=1.5cm, minimum width=2cm, minimum height=2cm, left=of cry] (smn) {Subject Monitor Native}; 5 | \node[blackbox, text width=1.5cm, minimum width=2cm, minimum height=2cm, left=of smn] (xv6) {xv6 VM}; 6 | \node[bluebox, minimum height=1cm, minimum width=9cm, text width=6cm] at (-3.5,-2.5) (mue) {Muen Separation Kernel}; 7 | 8 | \draw[gray] (-8,-2.25) to (1,-2.25); 9 | \draw[gray] (-5.84,-2.25) to (-5.84,0); 10 | \draw[gray] (-3.50,-2.25) to (-3.50,0); 11 | \draw[gray] (-1.14,-2.25) to (-1.14,0); 12 | \end{tikzpicture} 13 | -------------------------------------------------------------------------------- /components/ps2_drv/spec/ps2_drv.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /policy/hardware/common_hardware.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /kernel/doc/graph_operation.tex: -------------------------------------------------------------------------------- 1 | \begin{tikzpicture}[minimum height=0.6cm] 2 | \node (sch) [commonnode, bottom color=kernelcolor] {Handle\_Vmx\_Exit}; 3 | \node (knl) [commonnode, bottom color=kernelcolor, left=of sch] {Initialize}; 4 | \node (pln) [component, above=of sch, bottom color=usercolor] {Scheduling Plan}; 5 | \node (sub) [commonnode, bottom color=guestcolor, right=of sch] {Subject}; 6 | \node[gray, font=\scriptsize] at (0.8,2.3) {VMX root}; 7 | \node[gray, font=\scriptsize] at (2.6,2.3) {VMX non-root}; 8 | 9 | \draw[->] (pln) to (sch); 10 | \draw[->] (knl) to[bend right=65] node[auto] {VM enter} (sub); 11 | \draw[->] (sch) to[bend right=65] node[auto] {VM enter} (sub); 12 | \draw[->] (sub) to[bend right=65] node[auto] {VM exit} (sch); 13 | \draw[thin, dotted, gray] (1.6,-1.5) to (1.6,2.5); 14 | \end{tikzpicture} 15 | -------------------------------------------------------------------------------- /policy/xml/subject_storage_dm.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /components/example/doc/event_driven_main_loop.adb: -------------------------------------------------------------------------------- 1 | Main_Loop : 2 | loop 3 | if not Pending_Interrupt_Present then 4 | 5 | -- Go to sleep when no pending interrupts are present. 6 | 7 | CPU.Hlt; 8 | end if; 9 | 10 | -- Clear pending interrupts prior to processing by writing to our own 11 | -- interrupts page that is mapped into our address space using the 12 | -- monitor mechanism. This way interrupts that arrive while we are 13 | -- processing the ones that woke us up from sleep, will be marked as 14 | -- pending and not get lost. 15 | 16 | Clear_Pending_Interrupts; 17 | 18 | Process_Loop : 19 | loop 20 | Channel.Read (Data => Buffer, 21 | Data_Present => Received); 22 | exit when not Received; 23 | Process (Data => Buffer); 24 | end loop Process_Loop; 25 | end loop Main_Loop; 26 | -------------------------------------------------------------------------------- /doc/report/graph_phys_mem_layout_example.tex: -------------------------------------------------------------------------------- 1 | \begin{bytefield}{24} 2 | \bitbox[]{10}{} 3 | \bitbox[]{16}{$\vdots$}\\[1ex] 4 | \begin{rightwordgroup}{$\tau0$} 5 | \memsection{0021 6000}{0021 9fff}{2}{Code and data}\\ 6 | \memsection{0021 4000}{0021 5fff}{2}{I/O bitmap}\\ 7 | \memsection{0021 0000}{0021 3fff}{2}{Page table} 8 | \end{rightwordgroup}\\ 9 | \memsection{0020 4000}{0020 ffff}{3}{\color{Gray}-- free --}\\ 10 | \begin{rightwordgroup}{Kernel} 11 | \memsection{0020 0000}{0020 3fff}{2}{Kernel page table}\\ 12 | \memsection{001f f000}{001f ffff}{2}{$\tau0\rightarrow$kernel interface}\\ 13 | \memsection{001f e000}{001e ffff}{2}{Subject state descriptors}\\ 14 | \memsection{0011 c000}{001f dfff}{3}{\color{Gray}-- free --}\\ 15 | \memsection{0010 0000}{0011 bfff}{2}{Kernel code and data} 16 | \end{rightwordgroup}\\ 17 | \bitbox[]{10}{} 18 | \bitbox[]{16}{$\vdots$} 19 | \end{bytefield} 20 | -------------------------------------------------------------------------------- /components/time/src/tm.ads: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright (C) 2015 Reto Buerki 3 | -- Copyright (C) 2015 Adrian-Ken Rueegsegger 4 | -- 5 | -- This program is free software: you can redistribute it and/or modify 6 | -- it under the terms of the GNU General Public License as published by 7 | -- the Free Software Foundation, either version 3 of the License, or 8 | -- (at your option) any later version. 9 | -- 10 | -- This program is distributed in the hope that it will be useful, 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | -- GNU General Public License for more details. 14 | -- 15 | -- You should have received a copy of the GNU General Public License 16 | -- along with this program. If not, see . 17 | -- 18 | 19 | package Tm 20 | is 21 | 22 | end Tm; 23 | -------------------------------------------------------------------------------- /components/sm/src/devices.ads: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright (C) 2014 Reto Buerki 3 | -- Copyright (C) 2014 Adrian-Ken Rueegsegger 4 | -- 5 | -- This program is free software: you can redistribute it and/or modify 6 | -- it under the terms of the GNU General Public License as published by 7 | -- the Free Software Foundation, either version 3 of the License, or 8 | -- (at your option) any later version. 9 | -- 10 | -- This program is distributed in the hope that it will be useful, 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | -- GNU General Public License for more details. 14 | -- 15 | -- You should have received a copy of the GNU General Public License 16 | -- along with this program. If not, see . 17 | -- 18 | 19 | package Devices 20 | is 21 | end Devices; 22 | -------------------------------------------------------------------------------- /doc/report/graph_scheduling_plan.tex: -------------------------------------------------------------------------------- 1 | \begin{ganttchart}[ 2 | vgrid={*9{dotted},*1{dashed},*9{dotted}}, 3 | hgrid, 4 | y unit title=0.75cm, 5 | title label anchor/.style={below=-1.5ex}]{1}{20} 6 | \gantttitle{Major frame 1}{10} 7 | \gantttitle{Major frame 2}{10} \\ 8 | \ganttbar[bar/.append style={fill=Apricot}]{CPU0}{1}{10} 9 | \ganttbar[bar/.append style={fill=Apricot}]{}{11}{20} \\ 10 | \ganttbar[bar/.append style={fill=CornflowerBlue}]{CPU1}{1}{2} 11 | \ganttbar[bar/.append style={fill=YellowGreen}]{}{3}{6} 12 | \ganttbar[bar/.append style={fill=CornflowerBlue}]{}{7}{8} 13 | \ganttbar[bar/.append style={fill=YellowGreen}]{}{9}{10} 14 | \ganttbar[bar/.append style={fill=CornflowerBlue}]{}{11}{12} 15 | \ganttbar[bar/.append style={fill=YellowGreen}]{}{13}{16} 16 | \ganttbar[bar/.append style={fill=CornflowerBlue}]{}{17}{18} 17 | \ganttbar[bar/.append style={fill=YellowGreen}]{}{19}{20} 18 | \end{ganttchart} 19 | -------------------------------------------------------------------------------- /components/dm/src/dev_mngr.ads: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright (C) 2017 Reto Buerki 3 | -- Copyright (C) 2017 Adrian-Ken Rueegsegger 4 | -- 5 | -- This program is free software: you can redistribute it and/or modify 6 | -- it under the terms of the GNU General Public License as published by 7 | -- the Free Software Foundation, either version 3 of the License, or 8 | -- (at your option) any later version. 9 | -- 10 | -- This program is distributed in the hope that it will be useful, 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | -- GNU General Public License for more details. 14 | -- 15 | -- You should have received a copy of the GNU General Public License 16 | -- along with this program. If not, see . 17 | -- 18 | 19 | package Dev_Mngr 20 | is 21 | end Dev_Mngr; 22 | -------------------------------------------------------------------------------- /doc/report/graph_intel_architecture.tex: -------------------------------------------------------------------------------- 1 | \begin{tikzpicture} 2 | \node[apribox, minimum width=3cm, minimum height=1cm] (cpu) {CPU}; 3 | \node[bluebox] (gfx) [left=of cpu] {PCIe/Graphics Adapter}; 4 | \node[bluebox] (ram) [right=of cpu] {RAM}; 5 | 6 | \node[commonbox, minimum width=3cm, minimum height=1cm] (pch) [below=1cm of cpu] {PCH}; 7 | \node[greenbox] (network) [left=of pch] {Network}; 8 | \node[greenbox] (usb) [below left=of pch] {USB}; 9 | \node[greenbox] (pci) [below=of pch] {PCI Express}; 10 | \node[greenbox] (bios) [below right=of pch] {BIOS}; 11 | \node[greenbox] (legacy) [right=of pch] {Legacy}; 12 | 13 | \draw[thick] (cpu) to node[auto] {DMI} (pch); 14 | \draw[thick] (cpu) -- (gfx); 15 | \draw[thick] (cpu) -- (ram); 16 | \draw[thick] (pch) -- (network); 17 | \draw[thick] (pch) -- (usb); 18 | \draw[thick] (pch) -- (pci); 19 | \draw[thick] (pch) -- (bios); 20 | \draw[thick] (pch) -- (legacy); 21 | \end{tikzpicture} 22 | -------------------------------------------------------------------------------- /components/sm/src/exit_handlers.ads: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright (C) 2013 Reto Buerki 3 | -- Copyright (C) 2013 Adrian-Ken Rueegsegger 4 | -- 5 | -- This program is free software: you can redistribute it and/or modify 6 | -- it under the terms of the GNU General Public License as published by 7 | -- the Free Software Foundation, either version 3 of the License, or 8 | -- (at your option) any later version. 9 | -- 10 | -- This program is distributed in the hope that it will be useful, 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | -- GNU General Public License for more details. 14 | -- 15 | -- You should have received a copy of the GNU General Public License 16 | -- along with this program. If not, see . 17 | -- 18 | 19 | package Exit_Handlers 20 | is 21 | 22 | end Exit_Handlers; 23 | -------------------------------------------------------------------------------- /doc/report/files/restrictions.adc: -------------------------------------------------------------------------------- 1 | pragma Restrictions (No_Access_Subprograms); 2 | pragma Restrictions (No_Allocators); 3 | pragma Restrictions (No_Calendar); 4 | pragma Restrictions (No_Dispatch); 5 | pragma Restrictions (No_Enumeration_Maps); 6 | pragma Restrictions (No_Exception_Handlers); 7 | pragma Restrictions (No_Exceptions); 8 | pragma Restrictions (No_Fixed_Point); 9 | pragma Restrictions (No_Floating_Point); 10 | pragma Restrictions (No_Implicit_Dynamic_Code); 11 | pragma Restrictions (No_Implicit_Loops); 12 | pragma Restrictions (No_Initialize_Scalars); 13 | pragma Restrictions (No_IO); 14 | pragma Restrictions (No_Obsolescent_Features); 15 | pragma Restrictions (No_Recursion); 16 | pragma Restrictions (No_Secondary_Stack); 17 | pragma Restrictions (No_Streams); 18 | pragma Restrictions (No_Tasking); 19 | pragma Restrictions (No_Unchecked_Access); 20 | pragma Restrictions (No_Wide_Characters); 21 | pragma Restrictions (Static_Storage_Size); 22 | -------------------------------------------------------------------------------- /components/example/doc/subject_init_fsm.dot: -------------------------------------------------------------------------------- 1 | digraph subject_init_fsm { 2 | node [shape = doublecircle]; Initial; 3 | node [shape = point ]; Start 4 | 5 | node [shape = circle]; 6 | Start -> Initial; 7 | Initial -> Synced [ label = "SYNC" ]; 8 | Synced -> Erasing [ label = "ERASE" ]; 9 | Erasing -> Erased; 10 | Erased -> Preparing [ label = "PREPARE" ]; 11 | Synced -> Preparing [ label = "PREPARE" ]; 12 | Preparing -> Prepared; 13 | Prepared -> Validating [ label = "VALIDATE" ]; 14 | Validating -> Validated; 15 | Validated -> Initializing [ label = "RUN"]; 16 | Initializing -> Running; 17 | Running -> Finished; 18 | Erasing -> Error; 19 | Preparing -> Error; 20 | Validating -> Error; 21 | Running -> Error; 22 | Finished -> Error; 23 | Error -> Reset; 24 | Running -> Reset; 25 | Finished -> Reset; 26 | Reset -> Initial; 27 | } 28 | -------------------------------------------------------------------------------- /components/example/src/muenblock_client/disabled/muenblock_example.ads: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright (C) 2020 secunet Security Networks AG 3 | -- 4 | -- This program is free software: you can redistribute it and/or modify 5 | -- it under the terms of the GNU General Public License as published by 6 | -- the Free Software Foundation, either version 3 of the License, or 7 | -- (at your option) any later version. 8 | -- 9 | -- This program is distributed in the hope that it will be useful, 10 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | -- GNU General Public License for more details. 13 | -- 14 | -- You should have received a copy of the GNU General Public License 15 | -- along with this program. If not, see . 16 | -- 17 | 18 | package Muenblock_Example 19 | is 20 | 21 | procedure Show is null; 22 | 23 | end Muenblock_Example; 24 | -------------------------------------------------------------------------------- /components/isolation_tests/spec/isolation_tests.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 1 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /kernel/kernel_debug.gpr: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright (C) 2025 Reto Buerki 3 | -- Copyright (C) 2025 Adrian-Ken Rueegsegger 4 | -- 5 | -- This program is free software: you can redistribute it and/or modify 6 | -- it under the terms of the GNU General Public License as published by 7 | -- the Free Software Foundation, either version 3 of the License, or 8 | -- (at your option) any later version. 9 | -- 10 | -- This program is distributed in the hope that it will be useful, 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | -- GNU General Public License for more details. 14 | -- 15 | -- You should have received a copy of the GNU General Public License 16 | -- along with this program. If not, see . 17 | -- 18 | 19 | with "common_debug"; 20 | 21 | project Kernel_Debug extends "kernel" is 22 | end Kernel_Debug; 23 | -------------------------------------------------------------------------------- /components/time/src/time.adb: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright (C) 2015 Reto Buerki 3 | -- Copyright (C) 2015 Adrian-Ken Rueegsegger 4 | -- 5 | -- This program is free software: you can redistribute it and/or modify 6 | -- it under the terms of the GNU General Public License as published by 7 | -- the Free Software Foundation, either version 3 of the License, or 8 | -- (at your option) any later version. 9 | -- 10 | -- This program is distributed in the hope that it will be useful, 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | -- GNU General Public License for more details. 14 | -- 15 | -- You should have received a copy of the GNU General Public License 16 | -- along with this program. If not, see . 17 | -- 18 | 19 | with Tm.Main; 20 | 21 | procedure Time 22 | is 23 | begin 24 | Tm.Main.Run; 25 | end Time; 26 | -------------------------------------------------------------------------------- /policy/xml/subject_time.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 1 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /components/ps2_drv/src/ps2.ads: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright (C) 2016 Reto Buerki 3 | -- Copyright (C) 2016 Adrian-Ken Rueegsegger 4 | -- 5 | -- This program is free software: you can redistribute it and/or modify 6 | -- it under the terms of the GNU General Public License as published by 7 | -- the Free Software Foundation, either version 3 of the License, or 8 | -- (at your option) any later version. 9 | -- 10 | -- This program is distributed in the hope that it will be useful, 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | -- GNU General Public License for more details. 14 | -- 15 | -- You should have received a copy of the GNU General Public License 16 | -- along with this program. If not, see . 17 | -- 18 | 19 | package PS2 20 | is 21 | 22 | -- Handle PS/2 interrupt. 23 | procedure Handle_Interrupt; 24 | 25 | end PS2; 26 | -------------------------------------------------------------------------------- /components/src/input-event_channel-reader.ads: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright (C) 2016 Reto Buerki 3 | -- Copyright (C) 2016 Adrian-Ken Rueegsegger 4 | -- 5 | -- This program is free software: you can redistribute it and/or modify 6 | -- it under the terms of the GNU General Public License as published by 7 | -- the Free Software Foundation, either version 3 of the License, or 8 | -- (at your option) any later version. 9 | -- 10 | -- This program is distributed in the hope that it will be useful, 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | -- GNU General Public License for more details. 14 | -- 15 | -- You should have received a copy of the GNU General Public License 16 | -- along with this program. If not, see . 17 | -- 18 | 19 | with Muchannel.Readers; 20 | 21 | package Input.Event_Channel.Reader is new Input.Event_Channel.Readers; 22 | -------------------------------------------------------------------------------- /components/ahci_drv/README.md: -------------------------------------------------------------------------------- 1 | # AHCI Driver 2 | 3 | ## Introduction 4 | 5 | This ** AHCI Driver ** subject 'implements support for the AHCI Block. 6 | 7 | At the moment there are some restrictions / open items: 8 | - Only SATA devices supported. There is no support for ATAPI. 9 | - Only MBR partitions supported. 10 | - Error handling is nearly untested due to missing broken hardware. 11 | 12 | ## Configure the server 13 | 14 | The driver offers a server to handle requests from multiple client 15 | subjects using channels. The mapping of device-partitions to different 16 | channels (and thus to different client subjects) is made in the 17 | ports_config.ads file. 18 | 19 | ## Usage with muenblock-client from Linux 20 | 21 | Load the muenblock client module with the protocol Id 5155684453516f3d 22 | for both channels. See Linux muenblock readme for details. 23 | 24 | ## Usage from a native subject 25 | 26 | There is a muenblock-client interface. See example subject 27 | muenblock-example how to use it. 28 | -------------------------------------------------------------------------------- /components/dbgserver/src/sinks/shmem/enabled/dbg-shared_memory-stream-writer.ads: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright (C) 2018 secunet Security Networks AG 3 | -- 4 | -- This program is free software: you can redistribute it and/or modify 5 | -- it under the terms of the GNU General Public License as published by 6 | -- the Free Software Foundation, either version 3 of the License, or 7 | -- (at your option) any later version. 8 | -- 9 | -- This program is distributed in the hope that it will be useful, 10 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | -- GNU General Public License for more details. 13 | -- 14 | -- You should have received a copy of the GNU General Public License 15 | -- along with this program. If not, see . 16 | -- 17 | 18 | with Muchannel.Writer; 19 | 20 | pragma Elaborate_All (Muchannel.Writer); 21 | 22 | package Dbg.Shared_Memory.Stream.Writer is new Stream.Writer; 23 | -------------------------------------------------------------------------------- /components/ps2_drv/src/log.ads: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright (C) 2016 Reto Buerki 3 | -- Copyright (C) 2016 Adrian-Ken Rueegsegger 4 | -- 5 | -- This program is free software: you can redistribute it and/or modify 6 | -- it under the terms of the GNU General Public License as published by 7 | -- the Free Software Foundation, either version 3 of the License, or 8 | -- (at your option) any later version. 9 | -- 10 | -- This program is distributed in the hope that it will be useful, 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | -- GNU General Public License for more details. 14 | -- 15 | -- You should have received a copy of the GNU General Public License 16 | -- along with this program. If not, see . 17 | -- 18 | 19 | with Debuglog.Client; 20 | 21 | package Log 22 | is 23 | 24 | package Text_IO renames Debuglog.Client; 25 | 26 | end Log; 27 | -------------------------------------------------------------------------------- /kernel/src/sk-mcu__disabled.adb: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright (C) 2023 Reto Buerki 3 | -- Copyright (C) 2023 Adrian-Ken Rueegsegger 4 | -- 5 | -- This program is free software: you can redistribute it and/or modify 6 | -- it under the terms of the GNU General Public License as published by 7 | -- the Free Software Foundation, either version 3 of the License, or 8 | -- (at your option) any later version. 9 | -- 10 | -- This program is distributed in the hope that it will be useful, 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | -- GNU General Public License for more details. 14 | -- 15 | -- You should have received a copy of the GNU General Public License 16 | -- along with this program. If not, see . 17 | -- 18 | 19 | package body SK.MCU 20 | with 21 | SPARK_Mode => Off 22 | is 23 | 24 | procedure Process is null; 25 | 26 | end SK.MCU; 27 | -------------------------------------------------------------------------------- /components/example/doc/system_yield_sleep.xml: -------------------------------------------------------------------------------- 1 | 2 | ... 3 | 4 | 5 | .. 6 | 7 | ... 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 1 16 | 17 | 1 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | ... 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | ... 38 | 39 | ... 40 | 41 | -------------------------------------------------------------------------------- /components/vt/src/log.ads: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright (C) 2013, 2014 Reto Buerki 3 | -- Copyright (C) 2013, 2014 Adrian-Ken Rueegsegger 4 | -- 5 | -- This program is free software: you can redistribute it and/or modify 6 | -- it under the terms of the GNU General Public License as published by 7 | -- the Free Software Foundation, either version 3 of the License, or 8 | -- (at your option) any later version. 9 | -- 10 | -- This program is distributed in the hope that it will be useful, 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | -- GNU General Public License for more details. 14 | -- 15 | -- You should have received a copy of the GNU General Public License 16 | -- along with this program. If not, see . 17 | -- 18 | 19 | with Debuglog.Client; 20 | 21 | package Log 22 | is 23 | 24 | package Text_IO renames Debuglog.Client; 25 | 26 | end Log; 27 | -------------------------------------------------------------------------------- /components/dbgserver/src/sinks/shmem/enabled/dbg-shared_memory-stream-writer_instance.ads: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright (C) 2018 secunet Security Networks AG 3 | -- 4 | -- This program is free software: you can redistribute it and/or modify 5 | -- it under the terms of the GNU General Public License as published by 6 | -- the Free Software Foundation, either version 3 of the License, or 7 | -- (at your option) any later version. 8 | -- 9 | -- This program is distributed in the hope that it will be useful, 10 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | -- GNU General Public License for more details. 13 | -- 14 | -- You should have received a copy of the GNU General Public License 15 | -- along with this program. If not, see . 16 | -- 17 | 18 | with Muchannel.Writer; 19 | 20 | pragma Elaborate_All (Muchannel.Writer); 21 | 22 | package Dbg.Shared_Memory.Stream.Writer_Instance is new Stream.Writer; 23 | -------------------------------------------------------------------------------- /kernel/debug/console/serial/uart/sk-console_uart.ads: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright (C) 2015 Reto Buerki 3 | -- Copyright (C) 2015 Adrian-Ken Rueegsegger 4 | -- 5 | -- This program is free software: you can redistribute it and/or modify 6 | -- it under the terms of the GNU General Public License as published by 7 | -- the Free Software Foundation, either version 3 of the License, or 8 | -- (at your option) any later version. 9 | -- 10 | -- This program is distributed in the hope that it will be useful, 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | -- GNU General Public License for more details. 14 | -- 15 | -- You should have received a copy of the GNU General Public License 16 | -- along with this program. If not, see . 17 | -- 18 | 19 | with SK.UART_Pkg; 20 | with SK.Console_Serial; 21 | 22 | package SK.Console_UART is new Console_Serial (UART_Pkg => UART_Pkg); 23 | -------------------------------------------------------------------------------- /components/vt/src/input_events.ads: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright (C) 2016 Reto Buerki 3 | -- Copyright (C) 2016 Adrian-Ken Rueegsegger 4 | -- 5 | -- This program is free software: you can redistribute it and/or modify 6 | -- it under the terms of the GNU General Public License as published by 7 | -- the Free Software Foundation, either version 3 of the License, or 8 | -- (at your option) any later version. 9 | -- 10 | -- This program is distributed in the hope that it will be useful, 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | -- GNU General Public License for more details. 14 | -- 15 | -- You should have received a copy of the GNU General Public License 16 | -- along with this program. If not, see . 17 | -- 18 | 19 | package Input_Events 20 | is 21 | 22 | -- Read input event from channel and process it. 23 | procedure Process; 24 | 25 | end Input_Events; 26 | -------------------------------------------------------------------------------- /kernel/debug/console/serial/hsuart/sk-console_hsuart.ads: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright (C) 2020 Reto Buerki 3 | -- Copyright (C) 2020 Adrian-Ken Rueegsegger 4 | -- 5 | -- This program is free software: you can redistribute it and/or modify 6 | -- it under the terms of the GNU General Public License as published by 7 | -- the Free Software Foundation, either version 3 of the License, or 8 | -- (at your option) any later version. 9 | -- 10 | -- This program is distributed in the hope that it will be useful, 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | -- GNU General Public License for more details. 14 | -- 15 | -- You should have received a copy of the GNU General Public License 16 | -- along with this program. If not, see . 17 | -- 18 | 19 | with SK.UART_Pkg; 20 | with SK.Console_Serial; 21 | 22 | package SK.Console_HSUART is new Console_Serial (UART_Pkg => UART_Pkg); 23 | -------------------------------------------------------------------------------- /components/dbgserver/src/dbgserver.adb: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright (C) 2014 secunet Security Networks AG 3 | -- 4 | -- This program is free software: you can redistribute it and/or modify 5 | -- it under the terms of the GNU General Public License as published by 6 | -- the Free Software Foundation, either version 3 of the License, or 7 | -- (at your option) any later version. 8 | -- 9 | -- This program is distributed in the hope that it will be useful, 10 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | -- GNU General Public License for more details. 13 | -- 14 | -- You should have received a copy of the GNU General Public License 15 | -- along with this program. If not, see . 16 | -- 17 | 18 | with Dbg.Crash_Audit; 19 | 20 | procedure Dbgserver 21 | is 22 | begin 23 | Dbg.Initialize; 24 | Dbg.Crash_Audit.Process; 25 | loop 26 | Dbg.Run; 27 | Dbg.Yield; 28 | end loop; 29 | end Dbgserver; 30 | -------------------------------------------------------------------------------- /policy/xml/subject_ps2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 1 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /components/dbgserver/src/dbg-crash_audit.ads: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright (C) 2017 Reto Buerki 3 | -- Copyright (C) 2017 Adrian-Ken Rueegsegger 4 | -- 5 | -- This program is free software: you can redistribute it and/or modify 6 | -- it under the terms of the GNU General Public License as published by 7 | -- the Free Software Foundation, either version 3 of the License, or 8 | -- (at your option) any later version. 9 | -- 10 | -- This program is distributed in the hope that it will be useful, 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | -- GNU General Public License for more details. 14 | -- 15 | -- You should have received a copy of the GNU General Public License 16 | -- along with this program. If not, see . 17 | -- 18 | 19 | package Dbg.Crash_Audit 20 | is 21 | 22 | -- Process crash audit records if present. 23 | procedure Process; 24 | 25 | end Dbg.Crash_Audit; 26 | -------------------------------------------------------------------------------- /components/dbgserver/src/sinks/shmem/disabled/dbg-shared_memory.adb: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright (C) 2018 secunet Security Networks AG 3 | -- 4 | -- This program is free software: you can redistribute it and/or modify 5 | -- it under the terms of the GNU General Public License as published by 6 | -- the Free Software Foundation, either version 3 of the License, or 7 | -- (at your option) any later version. 8 | -- 9 | -- This program is distributed in the hope that it will be useful, 10 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | -- GNU General Public License for more details. 13 | -- 14 | -- You should have received a copy of the GNU General Public License 15 | -- along with this program. If not, see . 16 | -- 17 | 18 | package body Dbg.Shared_Memory 19 | is 20 | 21 | procedure Init is null; 22 | 23 | procedure Run (Output_Queue : in out Byte_Queue.Queue_Type) 24 | is null; 25 | 26 | end Dbg.Shared_Memory; 27 | -------------------------------------------------------------------------------- /components/dbgserver/src/subject_consoles/enabled/dbg-subject_consoles-stream-reader.ads: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright (C) 2020 Reto Buerki 3 | -- Copyright (C) 2020 Adrian-Ken Rueegsegger 4 | -- 5 | -- This program is free software: you can redistribute it and/or modify 6 | -- it under the terms of the GNU General Public License as published by 7 | -- the Free Software Foundation, either version 3 of the License, or 8 | -- (at your option) any later version. 9 | -- 10 | -- This program is distributed in the hope that it will be useful, 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | -- GNU General Public License for more details. 14 | -- 15 | -- You should have received a copy of the GNU General Public License 16 | -- along with this program. If not, see . 17 | -- 18 | 19 | with Muchannel.Readers; 20 | 21 | package Dbg.Subject_Consoles.Stream.Reader 22 | is new Dbg.Subject_Consoles.Stream.Readers; 23 | -------------------------------------------------------------------------------- /components/ps2_drv/src/ps2-keyboard.ads: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright (C) 2013, 2015 Reto Buerki 3 | -- Copyright (C) 2013, 2015 Adrian-Ken Rueegsegger 4 | -- 5 | -- This program is free software: you can redistribute it and/or modify 6 | -- it under the terms of the GNU General Public License as published by 7 | -- the Free Software Foundation, either version 3 of the License, or 8 | -- (at your option) any later version. 9 | -- 10 | -- This program is distributed in the hope that it will be useful, 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | -- GNU General Public License for more details. 14 | -- 15 | -- You should have received a copy of the GNU General Public License 16 | -- along with this program. If not, see . 17 | -- 18 | 19 | with SK; 20 | 21 | package PS2.Keyboard 22 | is 23 | 24 | -- Process keyboard data. 25 | procedure Process (Data : SK.Byte); 26 | 27 | end PS2.Keyboard; 28 | -------------------------------------------------------------------------------- /components/src/input-event_channel-writer_instance.ads: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright (C) 2016 Reto Buerki 3 | -- Copyright (C) 2016 Adrian-Ken Rueegsegger 4 | -- 5 | -- This program is free software: you can redistribute it and/or modify 6 | -- it under the terms of the GNU General Public License as published by 7 | -- the Free Software Foundation, either version 3 of the License, or 8 | -- (at your option) any later version. 9 | -- 10 | -- This program is distributed in the hope that it will be useful, 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | -- GNU General Public License for more details. 14 | -- 15 | -- You should have received a copy of the GNU General Public License 16 | -- along with this program. If not, see . 17 | -- 18 | 19 | with Muchannel.Writer; 20 | 21 | pragma Elaborate_All (Muchannel.Writer); 22 | 23 | package Input.Event_Channel.Writer_Instance is new Input.Event_Channel.Writer; 24 | -------------------------------------------------------------------------------- /kernel/debug/sk-debug_lock.ads: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright (C) 2013 Reto Buerki 3 | -- Copyright (C) 2013 Adrian-Ken Rueegsegger 4 | -- 5 | -- This program is free software: you can redistribute it and/or modify 6 | -- it under the terms of the GNU General Public License as published by 7 | -- the Free Software Foundation, either version 3 of the License, or 8 | -- (at your option) any later version. 9 | -- 10 | -- This program is distributed in the hope that it will be useful, 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | -- GNU General Public License for more details. 14 | -- 15 | -- You should have received a copy of the GNU General Public License 16 | -- along with this program. If not, see . 17 | -- 18 | 19 | package SK.Debug_Lock 20 | is 21 | 22 | -- Spin until lock is acquired. 23 | procedure Acquire; 24 | 25 | -- Unlock. 26 | procedure Release; 27 | 28 | end SK.Debug_Lock; 29 | -------------------------------------------------------------------------------- /policy/xml/subject_ahci.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /policy/xml/subject_dbgserver_common.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /components/src/stub.S: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013-2024 Reto Buerki 3 | * Copyright (C) 2013-2024 Adrian-Ken Rueegsegger 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | .section .text.init 20 | .global _main 21 | 22 | _main: 23 | // Set RBP to null for backtracing 24 | xor %rbp, %rbp 25 | call main 26 | // Should never return. Raise exception if ever reached. 27 | ud2 28 | -------------------------------------------------------------------------------- /doc/report/graph_virt_mem_layout_example.tex: -------------------------------------------------------------------------------- 1 | \newcommand{\vmemsection}[6]{ 2 | \bytefieldsetup{bitheight=#5\baselineskip} % define the height of the memsection 3 | \bitbox[]{8}{ 4 | \footnotesize\texttt{0x#2} % print virtual end address 5 | \\ \vspace{#5\baselineskip} \vspace{-2\baselineskip} \vspace{-#5pt} 6 | \footnotesize\texttt{0x#1} % print virtual start address 7 | } 8 | \bitbox{14}{#6} % print box with caption 9 | \bitbox[]{8}{ 10 | \footnotesize\texttt{0x#4} % print physical end address 11 | \\ \vspace{#5\baselineskip} \vspace{-2\baselineskip} \vspace{-#5pt} 12 | \footnotesize\texttt{0x#3} % print physical start address 13 | } 14 | } 15 | 16 | \begin{bytefield}{24} 17 | \vmemsection{001f f000}{001f ffff}{0010 0000}{0010 0fff}{2}{Subject interface}\\ 18 | \vmemsection{0021 9000}{0021 9fff}{0000 3000}{0000 3fff}{2}{Stack}\\ 19 | \vmemsection{0021 8000}{0021 8fff}{0000 2000}{0000 2fff}{2}{Data}\\ 20 | \vmemsection{0021 7000}{0021 7fff}{0000 1000}{0000 1fff}{2}{Read-only data}\\ 21 | \vmemsection{0021 6000}{0021 6fff}{0000 0000}{0000 0fff}{2}{Program code}\\ 22 | \end{bytefield} 23 | -------------------------------------------------------------------------------- /components/dbgserver/src/subject_consoles/enabled/dbg-subject_consoles-stream-writer_instance.ads: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright (C) 2020 Reto Buerki 3 | -- Copyright (C) 2020 Adrian-Ken Rueegsegger 4 | -- 5 | -- This program is free software: you can redistribute it and/or modify 6 | -- it under the terms of the GNU General Public License as published by 7 | -- the Free Software Foundation, either version 3 of the License, or 8 | -- (at your option) any later version. 9 | -- 10 | -- This program is distributed in the hope that it will be useful, 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | -- GNU General Public License for more details. 14 | -- 15 | -- You should have received a copy of the GNU General Public License 16 | -- along with this program. If not, see . 17 | -- 18 | 19 | with Muchannel.Writer; 20 | 21 | pragma Elaborate_All (Muchannel.Writer); 22 | 23 | package Dbg.Subject_Consoles.Stream.Writer_Instance 24 | is new Stream.Writer; 25 | -------------------------------------------------------------------------------- /components/example/src/log.ads: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright (C) 2019 Reto Buerki 3 | -- Copyright (C) 2019 Adrian-Ken Rueegsegger 4 | -- 5 | -- This program is free software: you can redistribute it and/or modify 6 | -- it under the terms of the GNU General Public License as published by 7 | -- the Free Software Foundation, either version 3 of the License, or 8 | -- (at your option) any later version. 9 | -- 10 | -- This program is distributed in the hope that it will be useful, 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | -- GNU General Public License for more details. 14 | -- 15 | -- You should have received a copy of the GNU General Public License 16 | -- along with this program. If not, see . 17 | -- 18 | 19 | with Musinfo.Instance; 20 | 21 | package Log 22 | is 23 | 24 | -- Output given message and start newline. 25 | procedure Put_Line (Item : String) 26 | with 27 | Pre => Musinfo.Instance.Is_Valid; 28 | 29 | end Log; 30 | -------------------------------------------------------------------------------- /components/isolation_tests/src/its-fpu.ads: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright (C) 2025 Reto Buerki 3 | -- Copyright (C) 2025 Adrian-Ken Rueegsegger 4 | -- 5 | -- This program is free software: you can redistribute it and/or modify 6 | -- it under the terms of the GNU General Public License as published by 7 | -- the Free Software Foundation, either version 3 of the License, or 8 | -- (at your option) any later version. 9 | -- 10 | -- This program is distributed in the hope that it will be useful, 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | -- GNU General Public License for more details. 14 | -- 15 | -- You should have received a copy of the GNU General Public License 16 | -- along with this program. If not, see . 17 | -- 18 | 19 | with Musinfo.Instance; 20 | 21 | package ITS.FPU 22 | is 23 | 24 | -- Verify initial FPU state. 25 | procedure Verify_Initial_State 26 | with 27 | Pre => Musinfo.Instance.Is_Valid; 28 | 29 | end ITS.FPU; 30 | -------------------------------------------------------------------------------- /doc/report/impl_debug.tex: -------------------------------------------------------------------------------- 1 | \subsection{Debug}\label{subsec:debug} 2 | When compiled in debug-mode\index{debug}, the kernel writes logging messages to 3 | the serial port configured in the system policy. The debug statements in the 4 | kernel code are wrapped in \texttt{pragma Debug}\index{pragma} statements, 5 | making it possible to remove these lines completely when compiling for production 6 | usage. 7 | 8 | \begin{lstlisting}[language=Ada, label=lst:debug-statement, caption=Kernel debug 9 | statement] 10 | Is_Bsp := Apic.Is_BSP; 11 | pragma Debug (Is_Bsp, KC.Put_Line 12 | (Item => "Booting Muen kernel " 13 | & SK.Version.Version_String & " (" 14 | & Standard'Compiler_Version & ")")); 15 | \end{lstlisting} 16 | 17 | Listing \ref{lst:debug-statement} shows the kernel greeter message which is only 18 | output by the kernel running on the BSP\index{BSP}. The \texttt{KC}\index{KC} 19 | package implements the \emph{kernel console} which provides procedures to write 20 | text and unsigned integers to the debug console. For more information about 21 | \texttt{pragma Debug} see \cite{GNAT:manual}. 22 | -------------------------------------------------------------------------------- /components/isolation_tests/src/its-events.ads: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright (C) 2021 Reto Buerki 3 | -- Copyright (C) 2021 Adrian-Ken Rueegsegger 4 | -- 5 | -- This program is free software: you can redistribute it and/or modify 6 | -- it under the terms of the GNU General Public License as published by 7 | -- the Free Software Foundation, either version 3 of the License, or 8 | -- (at your option) any later version. 9 | -- 10 | -- This program is distributed in the hope that it will be useful, 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | -- GNU General Public License for more details. 14 | -- 15 | -- You should have received a copy of the GNU General Public License 16 | -- along with this program. If not, see . 17 | -- 18 | 19 | with Musinfo.Instance; 20 | 21 | package ITS.Events 22 | is 23 | 24 | -- Trigger invalid event. 25 | procedure Trigger_Invalid_Event 26 | with 27 | Pre => Musinfo.Instance.Is_Valid; 28 | 29 | end ITS.Events; 30 | -------------------------------------------------------------------------------- /components/ps2_drv/src/ps2-mouse.ads: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright (C) 2015 Reto Buerki 3 | -- Copyright (C) 2015 Adrian-Ken Rueegsegger 4 | -- 5 | -- This program is free software: you can redistribute it and/or modify 6 | -- it under the terms of the GNU General Public License as published by 7 | -- the Free Software Foundation, either version 3 of the License, or 8 | -- (at your option) any later version. 9 | -- 10 | -- This program is distributed in the hope that it will be useful, 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | -- GNU General Public License for more details. 14 | -- 15 | -- You should have received a copy of the GNU General Public License 16 | -- along with this program. If not, see . 17 | -- 18 | 19 | with SK; 20 | 21 | package PS2.Mouse 22 | is 23 | 24 | -- Initialize mouse device. 25 | procedure Init (Success : out Boolean); 26 | 27 | -- Process mouse data. 28 | procedure Process (Data : SK.Byte); 29 | 30 | end PS2.Mouse; 31 | -------------------------------------------------------------------------------- /doc/report/graph_apic.tex: -------------------------------------------------------------------------------- 1 | \begin{tikzpicture} 2 | \node (du8) {}; 3 | \node[bluebox, minimum width=2cm, minimum height=1.4cm, label={[yshift=-18pt]CPU0}, left=5mm of du8] (cp0) {}; 4 | \node[graybox] (la0) at (cp0.south) [above=5pt] {LAPIC}; 5 | \node[bluebox, minimum width=2cm, minimum height=1.4cm, label={[yshift=-18pt]CPU1}, right=5mm of du8] (cp1) {}; 6 | \node[graybox] (la1) at (cp1.south) [above=5pt] {LAPIC}; 7 | 8 | \node[align=center, left=8mm of la0] (li0) {Local\\Interrupts}; 9 | \node[align=center, right=8mm of la1] (li1) {Local\\Interrupts}; 10 | 11 | \node[inner sep=0, below=6mm of cp0] (du0) {}; 12 | \node[inner sep=0, below=6mm of cp1] (du1) {}; 13 | 14 | \draw[arrow] (li0) -- (la0); 15 | \draw[arrow] (li1) -- (la1); 16 | \draw[thick, <->] (cp0) -- (du0); 17 | \draw[thick, <->] (cp1) -- (du1); 18 | \draw[very thick] (du0) to node[auto, name=sys] {System Bus} (du1); 19 | 20 | \node[apribox, below=6mm of sys] (ioa) {I/O APIC}; 21 | \node[align=center, right=of ioa] (ext) {External\\Interrupts}; 22 | 23 | \draw[thick, <->] (ioa) -- (sys); 24 | \draw[arrow] (ext) -- (ioa); 25 | \end{tikzpicture} 26 | -------------------------------------------------------------------------------- /policy/xml/common_events.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /components/idle/idle.gpr: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright (C) 2013 Reto Buerki 3 | -- Copyright (C) 2013 Adrian-Ken Rueegsegger 4 | -- 5 | -- This program is free software: you can redistribute it and/or modify 6 | -- it under the terms of the GNU General Public License as published by 7 | -- the Free Software Foundation, either version 3 of the License, or 8 | -- (at your option) any later version. 9 | -- 10 | -- This program is distributed in the hope that it will be useful, 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | -- GNU General Public License for more details. 14 | -- 15 | -- You should have received a copy of the GNU General Public License 16 | -- along with this program. If not, see . 17 | -- 18 | 19 | project Idle extends "../component_spark" is 20 | 21 | for Languages use ("Ada", "Asm"); 22 | for Source_Dirs use ("../src", "src"); 23 | for Object_Dir use "obj/" & Component_Spark.Build_Mode; 24 | 25 | for Main use ("idle"); 26 | 27 | end Idle; 28 | -------------------------------------------------------------------------------- /components/controller/spec/controller.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /kernel/doc/graph_scheduling_plan.tex: -------------------------------------------------------------------------------- 1 | \begin{ganttchart}[ 2 | vgrid={*9{dotted},*1{dashed},*9{dotted}}, 3 | hgrid, 4 | y unit title=0.75cm, 5 | title label anchor/.style={below=-1.5ex}]{1}{20} 6 | \gantttitle{Major frame 1}{10} 7 | \gantttitle{Major frame 2}{10} \\ 8 | \ganttbar[bar/.append style={top color=white, bottom color=kernelcolor}]{CPU0}{1}{10} 9 | \ganttbar[bar/.append style={top color=white, bottom color=kernelcolor}]{}{11}{20} \\ 10 | \ganttbar[bar/.append style={top color=white, bottom color=usercolor}]{CPU1}{1}{2} 11 | \ganttbar[bar/.append style={top color=white, bottom color=guestcolor}]{}{3}{6} 12 | \ganttbar[bar/.append style={top color=white, bottom color=usercolor}]{}{7}{8} 13 | \ganttbar[bar/.append style={top color=white, bottom color=guestcolor}]{}{9}{10} 14 | \ganttbar[bar/.append style={top color=white, bottom color=usercolor}]{}{11}{12} 15 | \ganttbar[bar/.append style={top color=white, bottom color=guestcolor}]{}{13}{16} 16 | \ganttbar[bar/.append style={top color=white, bottom color=usercolor}]{}{17}{18} 17 | \ganttbar[bar/.append style={top color=white, bottom color=guestcolor}]{}{19}{20} 18 | \end{ganttchart} 19 | -------------------------------------------------------------------------------- /components/ahci_drv/src/server.ads: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright (C) 2020 secunet Security Networks AG 3 | -- 4 | -- This program is free software: you can redistribute it and/or modify 5 | -- it under the terms of the GNU General Public License as published by 6 | -- the Free Software Foundation, either version 3 of the License, or 7 | -- (at your option) any later version. 8 | -- 9 | -- This program is distributed in the hope that it will be useful, 10 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | -- GNU General Public License for more details. 13 | -- 14 | -- You should have received a copy of the GNU General Public License 15 | -- along with this program. If not, see . 16 | -- 17 | 18 | with Musinfo.Instance; 19 | 20 | package Server 21 | is 22 | 23 | -- Init all devices / channels. 24 | procedure Init 25 | with 26 | Pre => Musinfo.Instance.Is_Valid; 27 | 28 | -- Processing loop. Should never return. 29 | procedure Process 30 | with 31 | Pre => Musinfo.Instance.Is_Valid; 32 | 33 | end Server; 34 | -------------------------------------------------------------------------------- /components/dbgserver/src/sinks/pcspkr/dbg-pc_speaker_dbg.ads: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright (C) 2018 secunet Security Networks AG 3 | -- 4 | -- This program is free software: you can redistribute it and/or modify 5 | -- it under the terms of the GNU General Public License as published by 6 | -- the Free Software Foundation, either version 3 of the License, or 7 | -- (at your option) any later version. 8 | -- 9 | -- This program is distributed in the hope that it will be useful, 10 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | -- GNU General Public License for more details. 13 | -- 14 | -- You should have received a copy of the GNU General Public License 15 | -- along with this program. If not, see . 16 | -- 17 | 18 | with Dbg.Byte_Queue; 19 | 20 | private package Dbg.PC_Speaker_Dbg 21 | is 22 | 23 | -- Init PC Speaker log sink. 24 | procedure Init; 25 | 26 | -- Write bytes in the output queue to the PC Speaker sink. 27 | procedure Run (Output_Queue : in out Byte_Queue.Queue_Type); 28 | 29 | end Dbg.PC_Speaker_Dbg; 30 | -------------------------------------------------------------------------------- /components/dbgserver/src/sinks/shmem/dbg-shared_memory.ads: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright (C) 2018 secunet Security Networks AG 3 | -- 4 | -- This program is free software: you can redistribute it and/or modify 5 | -- it under the terms of the GNU General Public License as published by 6 | -- the Free Software Foundation, either version 3 of the License, or 7 | -- (at your option) any later version. 8 | -- 9 | -- This program is distributed in the hope that it will be useful, 10 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | -- GNU General Public License for more details. 13 | -- 14 | -- You should have received a copy of the GNU General Public License 15 | -- along with this program. If not, see . 16 | -- 17 | 18 | with Dbg.Byte_Queue; 19 | 20 | private package Dbg.Shared_Memory 21 | is 22 | 23 | -- Init memory channel sink. 24 | procedure Init; 25 | 26 | -- Write bytes in the output queue to the memory channel sink. 27 | procedure Run (Output_Queue : in out Byte_Queue.Queue_Type); 28 | 29 | end Dbg.Shared_Memory; 30 | -------------------------------------------------------------------------------- /components/dbgserver/src/sinks/shmem/enabled/dbg-shared_memory-types.ads: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright (C) 2018 secunet Security Networks AG 3 | -- 4 | -- This program is free software: you can redistribute it and/or modify 5 | -- it under the terms of the GNU General Public License as published by 6 | -- the Free Software Foundation, either version 3 of the License, or 7 | -- (at your option) any later version. 8 | -- 9 | -- This program is distributed in the hope that it will be useful, 10 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | -- GNU General Public License for more details. 13 | -- 14 | -- You should have received a copy of the GNU General Public License 15 | -- along with this program. If not, see . 16 | -- 17 | 18 | with Dbg.Byte_Arrays; 19 | 20 | package Dbg.Shared_Memory.Types 21 | is 22 | 23 | subtype Data_Index is Natural range 1 .. 64; 24 | 25 | subtype Data_Type is Byte_Arrays.Byte_Array (Data_Index); 26 | 27 | Null_Data : constant Data_Type := (others => 0); 28 | 29 | end Dbg.Shared_Memory.Types; 30 | -------------------------------------------------------------------------------- /components/ps2_drv/src/ps2-output.ads: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright (C) 2016 Reto Buerki 3 | -- Copyright (C) 2016 Adrian-Ken Rueegsegger 4 | -- 5 | -- This program is free software: you can redistribute it and/or modify 6 | -- it under the terms of the GNU General Public License as published by 7 | -- the Free Software Foundation, either version 3 of the License, or 8 | -- (at your option) any later version. 9 | -- 10 | -- This program is distributed in the hope that it will be useful, 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | -- GNU General Public License for more details. 14 | -- 15 | -- You should have received a copy of the GNU General Public License 16 | -- along with this program. If not, see . 17 | -- 18 | 19 | with Input; 20 | 21 | package PS2.Output 22 | is 23 | 24 | -- Initialize output channel. 25 | procedure Init; 26 | 27 | -- Forward input event by writing it into output channel. 28 | procedure Write (Event : Input.Input_Event_Type); 29 | 30 | end PS2.Output; 31 | -------------------------------------------------------------------------------- /components/sm/spec/sm.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /components/controller/src/controller.adb: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright (C) 2020 Reto Buerki 3 | -- Copyright (C) 2020 Adrian-Ken Rueegsegger 4 | -- 5 | -- This program is free software: you can redistribute it and/or modify 6 | -- it under the terms of the GNU General Public License as published by 7 | -- the Free Software Foundation, either version 3 of the License, or 8 | -- (at your option) any later version. 9 | -- 10 | -- This program is distributed in the hope that it will be useful, 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | -- GNU General Public License for more details. 14 | -- 15 | -- You should have received a copy of the GNU General Public License 16 | -- along with this program. If not, see . 17 | -- 18 | 19 | with Debuglog.Client; 20 | 21 | with Ctrlr; 22 | 23 | procedure Controller 24 | is 25 | begin 26 | Debuglog.Client.Init (Epoch => 1); 27 | Debuglog.Client.Put_Line (Item => "Controller running"); 28 | 29 | loop 30 | Ctrlr.Run; 31 | Ctrlr.Yield; 32 | end loop; 33 | end Controller; 34 | -------------------------------------------------------------------------------- /components/example/src/memory_fills.ads: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright (C) 2023 Reto Buerki 3 | -- Copyright (C) 2023 Adrian-Ken Rueegsegger 4 | -- 5 | -- This program is free software: you can redistribute it and/or modify 6 | -- it under the terms of the GNU General Public License as published by 7 | -- the Free Software Foundation, either version 3 of the License, or 8 | -- (at your option) any later version. 9 | -- 10 | -- This program is distributed in the hope that it will be useful, 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | -- GNU General Public License for more details. 14 | -- 15 | -- You should have received a copy of the GNU General Public License 16 | -- along with this program. If not, see . 17 | -- 18 | 19 | with Musinfo.Instance; 20 | 21 | package Memory_Fills 22 | is 23 | 24 | -- Validates that the content of a memory region with fill pattern has the 25 | -- expected content. 26 | procedure Validate_Region_Content 27 | with 28 | Pre => Musinfo.Instance.Is_Valid; 29 | 30 | end Memory_Fills; 31 | -------------------------------------------------------------------------------- /components/idle/src/idle.adb: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright (C) 2013 Reto Buerki 3 | -- Copyright (C) 2013 Adrian-Ken Rueegsegger 4 | -- 5 | -- This program is free software: you can redistribute it and/or modify 6 | -- it under the terms of the GNU General Public License as published by 7 | -- the Free Software Foundation, either version 3 of the License, or 8 | -- (at your option) any later version. 9 | -- 10 | -- This program is distributed in the hope that it will be useful, 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | -- GNU General Public License for more details. 14 | -- 15 | -- You should have received a copy of the GNU General Public License 16 | -- along with this program. If not, see . 17 | -- 18 | 19 | with System.Machine_Code; 20 | 21 | procedure Idle 22 | is 23 | begin 24 | System.Machine_Code.Asm (Template => "sti", 25 | Volatile => True); 26 | loop 27 | System.Machine_Code.Asm (Template => "hlt", 28 | Volatile => True); 29 | end loop; 30 | end Idle; 31 | -------------------------------------------------------------------------------- /kernel/debug/console/serial/hsuart/sk-kc.ads: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright (C) 2020 Reto Buerki 3 | -- Copyright (C) 2020 Adrian-Ken Rueegsegger 4 | -- 5 | -- This program is free software: you can redistribute it and/or modify 6 | -- it under the terms of the GNU General Public License as published by 7 | -- the Free Software Foundation, either version 3 of the License, or 8 | -- (at your option) any later version. 9 | -- 10 | -- This program is distributed in the hope that it will be useful, 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | -- GNU General Public License for more details. 14 | -- 15 | -- You should have received a copy of the GNU General Public License 16 | -- along with this program. If not, see . 17 | -- 18 | 19 | with SK.Console; 20 | with SK.Console_HSUART; 21 | 22 | pragma Elaborate (SK.Console); 23 | 24 | -- Kernel debug console. 25 | package SK.KC is new SK.Console 26 | (Initialize => Console_HSUART.Init, 27 | Output_New_Line => Console_HSUART.New_Line, 28 | Output_Char => Console_HSUART.Put_Char); 29 | -------------------------------------------------------------------------------- /components/dm/dm.gpr: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright (C) 2017 Reto Buerki 3 | -- Copyright (C) 2017 Adrian-Ken Rueegsegger 4 | -- 5 | -- This program is free software: you can redistribute it and/or modify 6 | -- it under the terms of the GNU General Public License as published by 7 | -- the Free Software Foundation, either version 3 of the License, or 8 | -- (at your option) any later version. 9 | -- 10 | -- This program is distributed in the hope that it will be useful, 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | -- GNU General Public License for more details. 14 | -- 15 | -- You should have received a copy of the GNU General Public License 16 | -- along with this program. If not, see . 17 | -- 18 | 19 | with "common_strings"; 20 | with "libmudebuglog"; 21 | with "libmudm"; 22 | 23 | project Dm extends "../component_spark" is 24 | 25 | for Languages use ("Ada", "Asm"); 26 | for Source_Dirs use (external("GENERATED"), "src", "../src"); 27 | for Object_Dir use Component_Spark.Obj_Dir; 28 | for Main use ("dm"); 29 | 30 | end Dm; 31 | -------------------------------------------------------------------------------- /components/ps2_drv/src/interrupt_handler.ads: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright (C) 2016 Reto Buerki 3 | -- Copyright (C) 2016 Adrian-Ken Rueegsegger 4 | -- 5 | -- This program is free software: you can redistribute it and/or modify 6 | -- it under the terms of the GNU General Public License as published by 7 | -- the Free Software Foundation, either version 3 of the License, or 8 | -- (at your option) any later version. 9 | -- 10 | -- This program is distributed in the hope that it will be useful, 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | -- GNU General Public License for more details. 14 | -- 15 | -- You should have received a copy of the GNU General Public License 16 | -- along with this program. If not, see . 17 | -- 18 | 19 | with SK.Exceptions; 20 | 21 | package Interrupt_Handler 22 | is 23 | 24 | -- Interrupt handler. 25 | procedure Handle_Interrupt (Context : SK.Exceptions.Isr_Context_Type) 26 | with 27 | Export, 28 | Convention => C, 29 | Link_Name => "dispatch_interrupt"; 30 | 31 | end Interrupt_Handler; 32 | -------------------------------------------------------------------------------- /components/tau0/src/tau0_kernel_iface.ads: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright (C) 2013, 2014 Reto Buerki 3 | -- Copyright (C) 2013, 2014 Adrian-Ken Rueegsegger 4 | -- 5 | -- This program is free software: you can redistribute it and/or modify 6 | -- it under the terms of the GNU General Public License as published by 7 | -- the Free Software Foundation, either version 3 of the License, or 8 | -- (at your option) any later version. 9 | -- 10 | -- This program is distributed in the hope that it will be useful, 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | -- GNU General Public License for more details. 14 | -- 15 | -- You should have received a copy of the GNU General Public License 16 | -- along with this program. If not, see . 17 | -- 18 | 19 | package Tau0_Kernel_Iface 20 | with 21 | Abstract_State => (State with External => Async_Readers), 22 | Initializes => State 23 | is 24 | 25 | procedure Switch_Major_Frame 26 | with 27 | Global => (In_Out => State), 28 | Depends => (State =>+ null); 29 | 30 | end Tau0_Kernel_Iface; 31 | -------------------------------------------------------------------------------- /kernel/debug/console/serial/uart/sk-uart_pkg.ads: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright (C) 2015 Reto Buerki 3 | -- Copyright (C) 2015 Adrian-Ken Rueegsegger 4 | -- 5 | -- This program is free software: you can redistribute it and/or modify 6 | -- it under the terms of the GNU General Public License as published by 7 | -- the Free Software Foundation, either version 3 of the License, or 8 | -- (at your option) any later version. 9 | -- 10 | -- This program is distributed in the hope that it will be useful, 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | -- GNU General Public License for more details. 14 | -- 15 | -- You should have received a copy of the GNU General Public License 16 | -- along with this program. If not, see . 17 | -- 18 | 19 | with Skp.Hardware; 20 | 21 | with SK.UART; 22 | with SK.UART_8250; 23 | 24 | package SK.UART_Pkg is new UART 25 | (Base_Address => Skp.Hardware.Debugconsole_Port, 26 | Register_Type => Byte, 27 | Address_Type => Word16, 28 | Read => UART_8250.Read, 29 | Write => UART_8250.Write); 30 | -------------------------------------------------------------------------------- /kernel/src/sk-delays.ads: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright (C) 2017 Reto Buerki 3 | -- Copyright (C) 2017 Adrian-Ken Rueegsegger 4 | -- 5 | -- This program is free software: you can redistribute it and/or modify 6 | -- it under the terms of the GNU General Public License as published by 7 | -- the Free Software Foundation, either version 3 of the License, or 8 | -- (at your option) any later version. 9 | -- 10 | -- This program is distributed in the hope that it will be useful, 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | -- GNU General Public License for more details. 14 | -- 15 | -- You should have received a copy of the GNU General Public License 16 | -- along with this program. If not, see . 17 | -- 18 | 19 | with X86_64; 20 | 21 | --D @Interface 22 | --D Provides facilities to delay execution for a specified duration. 23 | package SK.Delays 24 | is 25 | 26 | -- Delay execution for given period in microseconds. 27 | procedure U_Delay (US : Natural) 28 | with 29 | Global => (Input => X86_64.State); 30 | 31 | end SK.Delays; 32 | -------------------------------------------------------------------------------- /components/dbgserver/src/sinks/pcspkr/disabled/dbg-pc_speaker_dbg.adb: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright (C) 2018 secunet Security Networks AG 3 | -- 4 | -- This program is free software: you can redistribute it and/or modify 5 | -- it under the terms of the GNU General Public License as published by 6 | -- the Free Software Foundation, either version 3 of the License, or 7 | -- (at your option) any later version. 8 | -- 9 | -- This program is distributed in the hope that it will be useful, 10 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | -- GNU General Public License for more details. 13 | -- 14 | -- You should have received a copy of the GNU General Public License 15 | -- along with this program. If not, see . 16 | -- 17 | 18 | package body Dbg.PC_Speaker_Dbg 19 | is 20 | 21 | ------------------------------------------------------------------------- 22 | 23 | procedure Init is null; 24 | 25 | ------------------------------------------------------------------------- 26 | 27 | procedure Run (Output_Queue : in out Byte_Queue.Queue_Type) is null; 28 | 29 | end Dbg.PC_Speaker_Dbg; 30 | -------------------------------------------------------------------------------- /components/vt/src/interrupt_handler.ads: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright (C) 2013-2022 Reto Buerki 3 | -- Copyright (C) 2013-2022 Adrian-Ken Rueegsegger 4 | -- 5 | -- This program is free software: you can redistribute it and/or modify 6 | -- it under the terms of the GNU General Public License as published by 7 | -- the Free Software Foundation, either version 3 of the License, or 8 | -- (at your option) any later version. 9 | -- 10 | -- This program is distributed in the hope that it will be useful, 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | -- GNU General Public License for more details. 14 | -- 15 | -- You should have received a copy of the GNU General Public License 16 | -- along with this program. If not, see . 17 | -- 18 | 19 | with SK.Exceptions; 20 | 21 | package Interrupt_Handler 22 | is 23 | 24 | -- Interrupt handler. 25 | procedure Handle_Interrupt (Context : SK.Exceptions.Isr_Context_Type) 26 | with 27 | Export, 28 | Convention => C, 29 | Link_Name => "dispatch_interrupt"; 30 | 31 | end Interrupt_Handler; 32 | -------------------------------------------------------------------------------- /kernel/debug/console/vga/sk-kc.ads: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright (C) 2013-2020 Reto Buerki 3 | -- Copyright (C) 2013-2020 Adrian-Ken Rueegsegger 4 | -- 5 | -- This program is free software: you can redistribute it and/or modify 6 | -- it under the terms of the GNU General Public License as published by 7 | -- the Free Software Foundation, either version 3 of the License, or 8 | -- (at your option) any later version. 9 | -- 10 | -- This program is distributed in the hope that it will be useful, 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | -- GNU General Public License for more details. 14 | -- 15 | -- You should have received a copy of the GNU General Public License 16 | -- along with this program. If not, see . 17 | -- 18 | 19 | with SK.Console; 20 | with SK.Legacy_VGA; 21 | 22 | pragma Elaborate (SK.Console); 23 | 24 | -- Kernel VGA debug console. 25 | package SK.KC is new SK.Console 26 | (Initialize => SK.Legacy_VGA.VGA.Init, 27 | Output_New_Line => SK.Legacy_VGA.VGA.New_Line, 28 | Output_Char => SK.Legacy_VGA.VGA.Put_Char); 29 | -------------------------------------------------------------------------------- /kernel/doc/tikzstyle.tex: -------------------------------------------------------------------------------- 1 | \definecolor{dark-gray} {RGB}{73,73,73} 2 | \definecolor{usercolor} {rgb}{0.6,0.7,0.9} 3 | \definecolor{kernelcolor} {rgb}{0.9,0.7,0.6} 4 | \definecolor{guestcolor} {rgb}{0.7,0.9,0.6} 5 | 6 | \tikzstyle{dropshadow} = [blur shadow={shadow blur steps=5,shadow xshift=.0ex, 7 | shadow yshift=-0.3ex,opacity=0.9, 8 | shadow blur radius=0.5ex}] 9 | 10 | \tikzstyle{compound} = [rectangle, draw, text centered, 11 | rounded corners, 12 | top color=white, 13 | bottom color=black!5, 14 | draw=black!10] 15 | 16 | \tikzstyle{component} = [compound, draw=black!70] 17 | 18 | \tikzstyle{basenode} = [component, align=center, 19 | rounded corners=1, minimum width=14ex, 20 | minimum height=5ex] 21 | \tikzstyle{commonnode} = [basenode, dropshadow] 22 | 23 | \tikzstyle{whitebox}=[basenode, fill=white, text=dark-gray, draw=dark-gray, minimum height=1cm] 24 | \tikzstyle{dashbox}=[whitebox, densely dashed] 25 | \tikzstyle{greenbox}=[commonnode, bottom color=guestcolor, minimum height=1cm] 26 | -------------------------------------------------------------------------------- /components/src/input-event_channel.ads: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright (C) 2016 Reto Buerki 3 | -- Copyright (C) 2016 Adrian-Ken Rueegsegger 4 | -- 5 | -- This program is free software: you can redistribute it and/or modify 6 | -- it under the terms of the GNU General Public License as published by 7 | -- the Free Software Foundation, either version 3 of the License, or 8 | -- (at your option) any later version. 9 | -- 10 | -- This program is distributed in the hope that it will be useful, 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | -- GNU General Public License for more details. 14 | -- 15 | -- You should have received a copy of the GNU General Public License 16 | -- along with this program. If not, see . 17 | -- 18 | 19 | with Muchannel; 20 | 21 | pragma Elaborate_All (Muchannel); 22 | 23 | -- Input event channel used to transport keyboard/mouse events. 24 | package Input.Event_Channel is new Muchannel 25 | (Element_Type => Input_Event_Type, 26 | Elements => 168, 27 | Null_Element => Null_Input_Event, 28 | Protocol => 16#9a0a8679dbc22dcb#); 29 | -------------------------------------------------------------------------------- /components/tau0/tau0.gpr: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright (C) 2013, 2014 Reto Buerki 3 | -- Copyright (C) 2013, 2014 Adrian-Ken Rueegsegger 4 | -- 5 | -- This program is free software: you can redistribute it and/or modify 6 | -- it under the terms of the GNU General Public License as published by 7 | -- the Free Software Foundation, either version 3 of the License, or 8 | -- (at your option) any later version. 9 | -- 10 | -- This program is distributed in the hope that it will be useful, 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | -- GNU General Public License for more details. 14 | -- 15 | -- You should have received a copy of the GNU General Public License 16 | -- along with this program. If not, see . 17 | -- 18 | 19 | project Tau0 extends "../component_spark" is 20 | 21 | Extra_Dirs := Component_Spark.Src_Dirs; 22 | 23 | for Languages use ("Ada", "Asm"); 24 | for Source_Dirs use ("src", "../src", external("POLICY_DIR")) & Extra_Dirs; 25 | for Object_Dir use "obj/" & Component_Spark.Build_Mode; 26 | for Main use ("tau0"); 27 | 28 | end Tau0; 29 | -------------------------------------------------------------------------------- /kernel/doc/graph_sk0.tex: -------------------------------------------------------------------------------- 1 | \begin{tikzpicture} 2 | \matrix[row sep=1mm, column sep=1mm, inner sep=1mm, minimum width=2cm, minimum height=1.5cm] (x) { 3 | \node[greenbox, align=left] (aa){\small Init}; & 4 | \node[greenbox, align=left] (ab){\small Signaling}; & 5 | \node[greenbox, align=left] (bb){\small Scheduler}; & 6 | \node[greenbox, align=left] (cc){\small VT-x \\ \small VT-d}; & 7 | \node[dashbox, align=left] (dd){\small Caps/ \\ \small Perms}; \\ 8 | \node[dashbox, align=left] (aa){\small Page \\ \small Tables}; & 9 | \node[dashbox, align=left] (ab){\small Message \\ \small Passing}; & 10 | \node[dashbox, align=left] (bb){\small Schedule \\ \small Planning}; & 11 | \node[dashbox, align=left] (cc){\small Memory \\ \small Allocator}; & 12 | \node[dashbox, align=left] (dd){\small Device \\ \small Allocator}; \\ 13 | \node[dashbox, align=left] (a){\small Device \\ \small Drivers}; & 14 | \node[dashbox, align=left] (b){\small User \\ \small Interface}; & 15 | \node[dashbox, align=left] (c){\small File \\ \small System}; & 16 | \node[dashbox, align=left] (d){\small VM \\ \small Monitor}; & 17 | \node[dashbox, align=left] (){\small Posix \\ \small Interface}; \\ 18 | }; 19 | \end{tikzpicture} 20 | -------------------------------------------------------------------------------- /components/ahci_drv/src/ahci-constants.ads: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright (C) 2017 Reto Buerki 3 | -- Copyright (C) 2017 Adrian-Ken Rueegsegger 4 | -- 5 | -- This program is free software: you can redistribute it and/or modify 6 | -- it under the terms of the GNU General Public License as published by 7 | -- the Free Software Foundation, either version 3 of the License, or 8 | -- (at your option) any later version. 9 | -- 10 | -- This program is distributed in the hope that it will be useful, 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | -- GNU General Public License for more details. 14 | -- 15 | -- You should have received a copy of the GNU General Public License 16 | -- along with this program. If not, see . 17 | -- 18 | 19 | package Ahci.Constants 20 | is 21 | 22 | AHCI_Class_Code : constant := 16#010601#; 23 | 24 | -- Serial ATA AHCI 1.3.1 Specification, section 3.1.1. 25 | Interface_Speed_Gen_1 : constant := 2#0001#; 26 | Interface_Speed_Gen_2 : constant := 2#0010#; 27 | Interface_Speed_Gen_3 : constant := 2#0011#; 28 | 29 | end Ahci.Constants; 30 | -------------------------------------------------------------------------------- /components/example/src/fpu.ads: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright (C) 2024 Reto Buerki 3 | -- Copyright (C) 2024 Adrian-Ken Rueegsegger 4 | -- 5 | -- This program is free software: you can redistribute it and/or modify 6 | -- it under the terms of the GNU General Public License as published by 7 | -- the Free Software Foundation, either version 3 of the License, or 8 | -- (at your option) any later version. 9 | -- 10 | -- This program is distributed in the hope that it will be useful, 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | -- GNU General Public License for more details. 14 | -- 15 | -- You should have received a copy of the GNU General Public License 16 | -- along with this program. If not, see . 17 | -- 18 | 19 | with Musinfo.Instance; 20 | 21 | package FPU 22 | is 23 | 24 | -- Dump current FPU state to log. 25 | procedure Log_State (Title : String) 26 | with 27 | Pre => Musinfo.Instance.Is_Valid; 28 | 29 | -- Do some tests using the FPU. 30 | procedure Do_Tests 31 | with 32 | Pre => Musinfo.Instance.Is_Valid; 33 | 34 | end FPU; 35 | -------------------------------------------------------------------------------- /doc/report/acknowledgments.tex: -------------------------------------------------------------------------------- 1 | \chapter*{Acknowledgments} 2 | \addcontentsline{toc}{chapter}{Acknowledgments} 3 | Foremost, we would like to express our sincere gratitude to our advisor Prof. 4 | Dr. Andreas Steffen for the continuous support in the course of our studies and 5 | for the guidance in writing this master thesis. His help and generosity allowed 6 | us to work in such an interesting field of research. 7 | 8 | Many thanks also to our colleagues and friends at secunet Security Networks AG 9 | in Germany, Alexander Senier, Robert Dorn and Stefan Berghofer for their 10 | tremendous assistance not only during this thesis, but also during the many 11 | projects we have realized together. We were able to learn a lot and without 12 | their support and immense knowledge in the area of high-security platforms we 13 | would not have been able to implement the Muen kernel in such short time. 14 | 15 | We thank Prof. Dr. Endre Bangerter from the University of Applied Sciences in 16 | Bern for being our expert and reviewer. Thanks also to Daniel Bigelow for 17 | proofreading the report. 18 | 19 | Last but not least, many thanks to our families and friends for their support 20 | and understanding throughout the writing of this master thesis. 21 | -------------------------------------------------------------------------------- /components/ahci_drv/ahci_drv.gpr: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright (C) 2017 Reto Buerki 3 | -- Copyright (C) 2017 Adrian-Ken Rueegsegger 4 | -- 5 | -- This program is free software: you can redistribute it and/or modify 6 | -- it under the terms of the GNU General Public License as published by 7 | -- the Free Software Foundation, either version 3 of the License, or 8 | -- (at your option) any later version. 9 | -- 10 | -- This program is distributed in the hope that it will be useful, 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | -- GNU General Public License for more details. 14 | -- 15 | -- You should have received a copy of the GNU General Public License 16 | -- along with this program. If not, see . 17 | -- 18 | 19 | with "libmuchannel"; 20 | with "libmudebuglog"; 21 | with "common_strings"; 22 | 23 | project Ahci_Drv extends "../component_spark" is 24 | 25 | for Languages use ("Ada", "Asm"); 26 | for Source_Dirs use (external("GENERATED"), "src", "../src"); 27 | for Object_Dir use Component_Spark.Obj_Dir; 28 | for Main use ("ahci_drv"); 29 | 30 | end Ahci_drv; 31 | -------------------------------------------------------------------------------- /components/dm/src/dev_mngr-sender.ads: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright (C) 2017 Reto Buerki 3 | -- Copyright (C) 2017 Adrian-Ken Rueegsegger 4 | -- 5 | -- This program is free software: you can redistribute it and/or modify 6 | -- it under the terms of the GNU General Public License as published by 7 | -- the Free Software Foundation, either version 3 of the License, or 8 | -- (at your option) any later version. 9 | -- 10 | -- This program is distributed in the hope that it will be useful, 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | -- GNU General Public License for more details. 14 | -- 15 | -- You should have received a copy of the GNU General Public License 16 | -- along with this program. If not, see . 17 | -- 18 | 19 | with Mudm; 20 | 21 | package Dev_Mngr.Sender 22 | with 23 | Abstract_State => (State with External => Async_Readers), 24 | Initializes => State 25 | is 26 | 27 | -- Copies the given response into the DM response page. 28 | procedure Send (Res : Mudm.Emul_Message_Type) 29 | with 30 | Global => (Output => State); 31 | 32 | end Dev_Mngr.Sender; 33 | -------------------------------------------------------------------------------- /components/sm/misc/config.xsl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | <include> 17 | 18 | </include> 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /components/dbgserver/src/dbg.ads: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright (C) 2014 secunet Security Networks AG 3 | -- 4 | -- This program is free software: you can redistribute it and/or modify 5 | -- it under the terms of the GNU General Public License as published by 6 | -- the Free Software Foundation, either version 3 of the License, or 7 | -- (at your option) any later version. 8 | -- 9 | -- This program is distributed in the hope that it will be useful, 10 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | -- GNU General Public License for more details. 13 | -- 14 | -- You should have received a copy of the GNU General Public License 15 | -- along with this program. If not, see . 16 | -- 17 | 18 | private with Dbgserver_Component.Channel_Arrays; 19 | 20 | package Dbg 21 | is 22 | 23 | -- Initialize log server. 24 | procedure Initialize; 25 | 26 | -- Run log server. 27 | procedure Run; 28 | 29 | -- Yield execution. 30 | procedure Yield 31 | with Global => null; 32 | 33 | private 34 | 35 | type Subject_Buffer_Range is range 36 | 1 .. Dbgserver_Component.Channel_Arrays.Log_Channels_Element_Count; 37 | 38 | end Dbg; 39 | -------------------------------------------------------------------------------- /components/isolation_tests_monitor/isolation_tests_monitor.gpr: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright (C) 2021 Reto Buerki 3 | -- Copyright (C) 2021 Adrian-Ken Rueegsegger 4 | -- 5 | -- This program is free software: you can redistribute it and/or modify 6 | -- it under the terms of the GNU General Public License as published by 7 | -- the Free Software Foundation, either version 3 of the License, or 8 | -- (at your option) any later version. 9 | -- 10 | -- This program is distributed in the hope that it will be useful, 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | -- GNU General Public License for more details. 14 | -- 15 | -- You should have received a copy of the GNU General Public License 16 | -- along with this program. If not, see . 17 | -- 18 | 19 | project Isolation_Tests_Monitor extends "../component_spark" is 20 | 21 | for Languages use ("Ada", "Asm"); 22 | for Source_Dirs use (external("GENERATED"), "src", "../src") & Component_Spark.Src_Dirs; 23 | for Object_Dir use "obj/" & Component_Spark.Build_Mode; 24 | for Main use ("isolation_tests_monitor"); 25 | 26 | end Isolation_Tests_monitor; 27 | -------------------------------------------------------------------------------- /components/vt/src/mux.ads: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright (C) 2013 Reto Buerki 3 | -- Copyright (C) 2013 Adrian-Ken Rueegsegger 4 | -- 5 | -- This program is free software: you can redistribute it and/or modify 6 | -- it under the terms of the GNU General Public License as published by 7 | -- the Free Software Foundation, either version 3 of the License, or 8 | -- (at your option) any later version. 9 | -- 10 | -- This program is distributed in the hope that it will be useful, 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | -- GNU General Public License for more details. 14 | -- 15 | -- You should have received a copy of the GNU General Public License 16 | -- along with this program. If not, see . 17 | -- 18 | 19 | with Vt_Component.Channel_Arrays; 20 | 21 | package Mux 22 | is 23 | 24 | package Cspecs renames Vt_Component.Channel_Arrays; 25 | 26 | -- Number of input channels. 27 | type Input_Channel_Range is range 1 .. Cspecs.Input_Devices_Element_Count; 28 | 29 | -- Number of output channels. 30 | type Output_Channel_Range is range 1 .. Cspecs.Console_Element_Count; 31 | 32 | end Mux; 33 | -------------------------------------------------------------------------------- /components/component_spark.gpr: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright (C) 2014, 2015 Reto Buerki 3 | -- Copyright (C) 2014, 2015 Adrian-Ken Rueegsegger 4 | -- 5 | -- This program is free software: you can redistribute it and/or modify 6 | -- it under the terms of the GNU General Public License as published by 7 | -- the Free Software Foundation, either version 3 of the License, or 8 | -- (at your option) any later version. 9 | -- 10 | -- This program is distributed in the hope that it will be useful, 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | -- GNU General Public License for more details. 14 | -- 15 | -- You should have received a copy of the GNU General Public License 16 | -- along with this program. If not, see . 17 | -- 18 | 19 | with "shared"; 20 | 21 | abstract project Component_Spark extends "common.gpr" is 22 | 23 | Obj_Dir := external("OBJ_DIR", "obj/") & Common.Build_Mode; 24 | Exec_Dir := external("EXEC_DIR", "bin/") & Common.Build_Mode; 25 | 26 | package Linker is 27 | for Default_Switches ("Ada") use Shared.Spark_Linker_Switches; 28 | end Linker; 29 | 30 | end Component_Spark; 31 | -------------------------------------------------------------------------------- /components/dm/src/dev_mngr-receiver.ads: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright (C) 2017 Reto Buerki 3 | -- Copyright (C) 2017 Adrian-Ken Rueegsegger 4 | -- 5 | -- This program is free software: you can redistribute it and/or modify 6 | -- it under the terms of the GNU General Public License as published by 7 | -- the Free Software Foundation, either version 3 of the License, or 8 | -- (at your option) any later version. 9 | -- 10 | -- This program is distributed in the hope that it will be useful, 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | -- GNU General Public License for more details. 14 | -- 15 | -- You should have received a copy of the GNU General Public License 16 | -- along with this program. If not, see . 17 | -- 18 | 19 | with Mudm; 20 | 21 | package Dev_Mngr.Receiver 22 | with 23 | Abstract_State => (State with External => Async_Writers) 24 | is 25 | 26 | -- Fills the current request into the given req parameter. 27 | procedure Receive (Req : out Mudm.Emul_Message_Type) 28 | with 29 | Global => (Input => State), 30 | Depends => (Req => State); 31 | 32 | end Dev_Mngr.Receiver; 33 | -------------------------------------------------------------------------------- /components/ps2_drv/ps2_drv.gpr: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright (C) 2016 Reto Buerki 3 | -- Copyright (C) 2016 Adrian-Ken Rueegsegger 4 | -- 5 | -- This program is free software: you can redistribute it and/or modify 6 | -- it under the terms of the GNU General Public License as published by 7 | -- the Free Software Foundation, either version 3 of the License, or 8 | -- (at your option) any later version. 9 | -- 10 | -- This program is distributed in the hope that it will be useful, 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | -- GNU General Public License for more details. 14 | -- 15 | -- You should have received a copy of the GNU General Public License 16 | -- along with this program. If not, see . 17 | -- 18 | 19 | with "libmudebuglog"; 20 | with "common_strings"; 21 | with "muen_common"; 22 | 23 | project Ps2_Drv extends "../component_spark" is 24 | 25 | for Languages use ("Ada", "Asm"); 26 | for Source_Dirs use 27 | (external("GENERATED"), 28 | "src", "../src"); 29 | for Object_Dir use "obj/" & Component_Spark.Build_Mode; 30 | 31 | for Main use ("ps2_drv"); 32 | 33 | end Ps2_Drv; 34 | -------------------------------------------------------------------------------- /components/vt/vt.gpr: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright (C) 2013, 2014 Reto Buerki 3 | -- Copyright (C) 2013, 2014 Adrian-Ken Rueegsegger 4 | -- 5 | -- This program is free software: you can redistribute it and/or modify 6 | -- it under the terms of the GNU General Public License as published by 7 | -- the Free Software Foundation, either version 3 of the License, or 8 | -- (at your option) any later version. 9 | -- 10 | -- This program is distributed in the hope that it will be useful, 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | -- GNU General Public License for more details. 14 | -- 15 | -- You should have received a copy of the GNU General Public License 16 | -- along with this program. If not, see . 17 | -- 18 | 19 | with "muen_common"; 20 | with "common_debug"; 21 | with "libmudebuglog"; 22 | 23 | project Vt extends "../component_spark" is 24 | 25 | for Languages use ("Ada", "Asm"); 26 | for Source_Dirs use 27 | ("../src", 28 | external ("GENERATED"), 29 | "src"); 30 | for Object_Dir use "obj/" & Component_Spark.Build_Mode; 31 | 32 | for Main use ("vt"); 33 | 34 | end Vt; 35 | -------------------------------------------------------------------------------- /components/example/src/foo-receiver.ads: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright (C) 2013, 2014 Reto Buerki 3 | -- Copyright (C) 2013, 2014 Adrian-Ken Rueegsegger 4 | -- 5 | -- This program is free software: you can redistribute it and/or modify 6 | -- it under the terms of the GNU General Public License as published by 7 | -- the Free Software Foundation, either version 3 of the License, or 8 | -- (at your option) any later version. 9 | -- 10 | -- This program is distributed in the hope that it will be useful, 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | -- GNU General Public License for more details. 14 | -- 15 | -- You should have received a copy of the GNU General Public License 16 | -- along with this program. If not, see . 17 | -- 18 | 19 | package Foo.Receiver 20 | with 21 | Abstract_State => (State with External => Async_Writers), 22 | Initializes => State 23 | is 24 | 25 | -- Fills the current request into the given req parameter. 26 | procedure Receive (Req : out Message_Type) 27 | with 28 | Global => (Input => State), 29 | Depends => (Req => State); 30 | 31 | end Foo.Receiver; 32 | -------------------------------------------------------------------------------- /components/controller/controller.gpr: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright (C) 2020 Reto Buerki 3 | -- Copyright (C) 2020 Adrian-Ken Rueegsegger 4 | -- 5 | -- This program is free software: you can redistribute it and/or modify 6 | -- it under the terms of the GNU General Public License as published by 7 | -- the Free Software Foundation, either version 3 of the License, or 8 | -- (at your option) any later version. 9 | -- 10 | -- This program is distributed in the hope that it will be useful, 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | -- GNU General Public License for more details. 14 | -- 15 | -- You should have received a copy of the GNU General Public License 16 | -- along with this program. If not, see . 17 | -- 18 | 19 | with "common_strings"; 20 | with "muinterrupts"; 21 | with "libmudebuglog"; 22 | with "libmucontroltypes"; 23 | 24 | project Controller extends "../component_spark" is 25 | 26 | for Languages use ("Ada", "Asm"); 27 | for Source_Dirs use (external("GENERATED"), "src", "../src"); 28 | for Object_Dir use Component_Spark.Obj_Dir; 29 | for Main use ("controller"); 30 | 31 | end Controller; 32 | -------------------------------------------------------------------------------- /components/sl/debug/debug_ops.ads: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright (C) 2016 Reto Buerki 3 | -- Copyright (C) 2016 Adrian-Ken Rueegsegger 4 | -- 5 | -- This program is free software: you can redistribute it and/or modify 6 | -- it under the terms of the GNU General Public License as published by 7 | -- the Free Software Foundation, either version 3 of the License, or 8 | -- (at your option) any later version. 9 | -- 10 | -- This program is distributed in the hope that it will be useful, 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | -- GNU General Public License for more details. 14 | -- 15 | -- You should have received a copy of the GNU General Public License 16 | -- along with this program. If not, see . 17 | -- 18 | 19 | with Musinfo; 20 | 21 | package Debug_Ops 22 | is 23 | 24 | -- Output given name. 25 | procedure Put_Name (Item : Musinfo.Name_Type); 26 | 27 | -- Output given message/name and start newline. 28 | procedure Put 29 | (Msg : String; 30 | Name : Musinfo.Name_Type); 31 | 32 | -- Output given hash. 33 | procedure Put_Hash (Item : Musinfo.Hash_Type); 34 | 35 | end Debug_Ops; 36 | -------------------------------------------------------------------------------- /policy/xml/subject_storage_sm.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /components/isolation_tests/src/its-io_ports.ads: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright (C) 2021 Reto Buerki 3 | -- Copyright (C) 2021 Adrian-Ken Rueegsegger 4 | -- 5 | -- This program is free software: you can redistribute it and/or modify 6 | -- it under the terms of the GNU General Public License as published by 7 | -- the Free Software Foundation, either version 3 of the License, or 8 | -- (at your option) any later version. 9 | -- 10 | -- This program is distributed in the hope that it will be useful, 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | -- GNU General Public License for more details. 14 | -- 15 | -- You should have received a copy of the GNU General Public License 16 | -- along with this program. If not, see . 17 | -- 18 | 19 | with Musinfo.Instance; 20 | 21 | package ITS.IO_Ports 22 | is 23 | 24 | -- Write access to disallowed I/O port. 25 | procedure Write_To_Disallowed_IO_Port 26 | with 27 | Pre => Musinfo.Instance.Is_Valid; 28 | 29 | -- Read access to disallowed I/O port. 30 | procedure Read_From_Disallowed_IO_Port 31 | with 32 | Pre => Musinfo.Instance.Is_Valid; 33 | 34 | end ITS.IO_Ports; 35 | -------------------------------------------------------------------------------- /components/sm/src/exit_handlers-cr_access.ads: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright (C) 2013, 2014, 2016 Reto Buerki 3 | -- Copyright (C) 2013, 2014, 2016 Adrian-Ken Rueegsegger 4 | -- 5 | -- This program is free software: you can redistribute it and/or modify 6 | -- it under the terms of the GNU General Public License as published by 7 | -- the Free Software Foundation, either version 3 of the License, or 8 | -- (at your option) any later version. 9 | -- 10 | -- This program is distributed in the hope that it will be useful, 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | -- GNU General Public License for more details. 14 | -- 15 | -- You should have received a copy of the GNU General Public License 16 | -- along with this program. If not, see . 17 | -- 18 | 19 | with Subject_Info; 20 | with Types; 21 | 22 | package Exit_Handlers.CR_Access 23 | is 24 | 25 | -- Emulate control register access. 26 | procedure Process (Action : out Types.Subject_Action_Type) 27 | with 28 | Global => (In_Out => Subject_Info.State), 29 | Depends => ((Action, Subject_Info.State) => Subject_Info.State); 30 | 31 | end Exit_Handlers.CR_Access; 32 | -------------------------------------------------------------------------------- /components/muinit/muinit.ld: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020 Reto Buerki 3 | * Copyright (C) 2020 Adrian-Ken Rueegsegger 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | ENTRY(_main) 20 | 21 | SECTIONS 22 | { 23 | .text 0x100000 : 24 | { 25 | muinit.o 26 | *(.text .text.*) 27 | } 28 | 29 | .data ALIGN (4096) : 30 | { 31 | *(.data .data.*) 32 | } 33 | 34 | .bss : 35 | { 36 | *(.bss .bss.*) 37 | } 38 | 39 | .rodata ALIGN (4096) : 40 | { 41 | *(.rodata .rodata.*) 42 | } 43 | 44 | /DISCARD/ : 45 | { 46 | *(.comment) 47 | *(.eh_frame) 48 | *(.eh_frame_hdr) 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /components/time/time.gpr: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright (C) 2015 Reto Buerki 3 | -- Copyright (C) 2015 Adrian-Ken Rueegsegger 4 | -- 5 | -- This program is free software: you can redistribute it and/or modify 6 | -- it under the terms of the GNU General Public License as published by 7 | -- the Free Software Foundation, either version 3 of the License, or 8 | -- (at your option) any later version. 9 | -- 10 | -- This program is distributed in the hope that it will be useful, 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | -- GNU General Public License for more details. 14 | -- 15 | -- You should have received a copy of the GNU General Public License 16 | -- along with this program. If not, see . 17 | -- 18 | 19 | with "common_strings"; 20 | with "libmudebuglog"; 21 | with "libmutime"; 22 | with "libmusinfo"; 23 | with "libmucontrol"; 24 | 25 | project Time extends "../component_spark" is 26 | 27 | for Languages use ("Ada", "Asm"); 28 | for Source_Dirs use (external("GENERATED"), "src", "../src") 29 | & Component_Spark.Src_Dirs; 30 | for Object_Dir use Component_Spark.Obj_Dir; 31 | for Main use ("time"); 32 | 33 | end Time; 34 | -------------------------------------------------------------------------------- /components/dbgserver/src/sinks/serial/disabled/dbg-serial.adb: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright (C) 2014 secunet Security Networks AG 3 | -- 4 | -- This program is free software: you can redistribute it and/or modify 5 | -- it under the terms of the GNU General Public License as published by 6 | -- the Free Software Foundation, either version 3 of the License, or 7 | -- (at your option) any later version. 8 | -- 9 | -- This program is distributed in the hope that it will be useful, 10 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | -- GNU General Public License for more details. 13 | -- 14 | -- You should have received a copy of the GNU General Public License 15 | -- along with this program. If not, see . 16 | -- 17 | 18 | package body Dbg.Serial 19 | is 20 | 21 | ------------------------------------------------------------------------- 22 | 23 | procedure Init is null; 24 | 25 | ------------------------------------------------------------------------- 26 | 27 | procedure Run 28 | (Console : in out Consoles.Console_Type; 29 | Input_Queue : in out Byte_Queue.Queue_Type; 30 | Output_Queue : in out Byte_Queue.Queue_Type) 31 | is null; 32 | 33 | end Dbg.Serial; 34 | -------------------------------------------------------------------------------- /components/tau0/src/tau0.adb: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright (C) 2013, 2014 Reto Buerki 3 | -- Copyright (C) 2013, 2014 Adrian-Ken Rueegsegger 4 | -- 5 | -- This program is free software: you can redistribute it and/or modify 6 | -- it under the terms of the GNU General Public License as published by 7 | -- the Free Software Foundation, either version 3 of the License, or 8 | -- (at your option) any later version. 9 | -- 10 | -- This program is distributed in the hope that it will be useful, 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | -- GNU General Public License for more details. 14 | -- 15 | -- You should have received a copy of the GNU General Public License 16 | -- along with this program. If not, see . 17 | -- 18 | 19 | with SK; 20 | 21 | with Tau0_Kernel_Iface; 22 | 23 | procedure Tau0 24 | with 25 | Global => (In_Out => Tau0_Kernel_Iface.State) 26 | is 27 | use type SK.Word32; 28 | 29 | Counter : SK.Word32; 30 | begin 31 | Counter := 0; 32 | 33 | loop 34 | if Counter mod 2**20 = 0 then 35 | Tau0_Kernel_Iface.Switch_Major_Frame; 36 | end if; 37 | Counter := Counter + 1; 38 | end loop; 39 | end Tau0; 40 | -------------------------------------------------------------------------------- /kernel/src/sk-vtd-interrupts.ads: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright (C) 2014 Reto Buerki 3 | -- Copyright (C) 2014 Adrian-Ken Rueegsegger 4 | -- 5 | -- This program is free software: you can redistribute it and/or modify 6 | -- it under the terms of the GNU General Public License as published by 7 | -- the Free Software Foundation, either version 3 of the License, or 8 | -- (at your option) any later version. 9 | -- 10 | -- This program is distributed in the hope that it will be useful, 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | -- GNU General Public License for more details. 14 | -- 15 | -- You should have received a copy of the GNU General Public License 16 | -- along with this program. If not, see . 17 | -- 18 | 19 | with SK.IO_Apic; 20 | 21 | --D @Interface 22 | --D This package provides a procedure to setup I/O APIC IRQ routing when IOMMU 23 | --D Interrupt Remapping is enabled. 24 | package SK.VTd.Interrupts 25 | is 26 | 27 | -- Setup I/O APIC IRQ routing (VT-d enabled). 28 | procedure Setup_IRQ_Routing 29 | with 30 | Global => (In_Out => IO_Apic.State), 31 | Depends => (IO_Apic.State =>+ null); 32 | 33 | end SK.VTd.Interrupts; 34 | -------------------------------------------------------------------------------- /components/dbgserver/src/sinks/serial/enabled/uart/dbg-serial-uart.ads: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright (C) 2020 Reto Buerki 3 | -- Copyright (C) 2020 Adrian-Ken Rueegsegger 4 | -- 5 | -- This program is free software: you can redistribute it and/or modify 6 | -- it under the terms of the GNU General Public License as published by 7 | -- the Free Software Foundation, either version 3 of the License, or 8 | -- (at your option) any later version. 9 | -- 10 | -- This program is distributed in the hope that it will be useful, 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | -- GNU General Public License for more details. 14 | -- 15 | -- You should have received a copy of the GNU General Public License 16 | -- along with this program. If not, see . 17 | -- 18 | 19 | with SK.UART; 20 | with SK.UART_8250; 21 | 22 | with Dbgserver_Component.Devices; 23 | 24 | private package Dbg.Serial.UART is new SK.UART 25 | (Base_Address => Dbgserver_Component.Devices.Debugconsole_Port_Start, 26 | Register_Type => SK.Byte, 27 | Address_Type => SK.Word16, 28 | FIFO_Size => FIFO_Size, 29 | Read => SK.UART_8250.Read, 30 | Write => SK.UART_8250.Write); 31 | -------------------------------------------------------------------------------- /components/dbgserver/src/sinks/xhcidbg/disabled/dbg-xhci_dbg.adb: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright (C) 2016 secunet Security Networks AG 3 | -- 4 | -- This program is free software: you can redistribute it and/or modify 5 | -- it under the terms of the GNU General Public License as published by 6 | -- the Free Software Foundation, either version 3 of the License, or 7 | -- (at your option) any later version. 8 | -- 9 | -- This program is distributed in the hope that it will be useful, 10 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | -- GNU General Public License for more details. 13 | -- 14 | -- You should have received a copy of the GNU General Public License 15 | -- along with this program. If not, see . 16 | -- 17 | 18 | package body Dbg.Xhci_Dbg 19 | is 20 | 21 | ------------------------------------------------------------------------- 22 | 23 | procedure Init is null; 24 | 25 | ------------------------------------------------------------------------- 26 | 27 | procedure Run 28 | (Console : in out Consoles.Console_Type; 29 | Input_Queue : in out Byte_Queue.Queue_Type; 30 | Output_Queue : in out Byte_Queue.Queue_Type) 31 | is null; 32 | 33 | end Dbg.Xhci_Dbg; 34 | -------------------------------------------------------------------------------- /components/example/src/foo-sender.ads: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright (C) 2013 Reto Buerki 3 | -- Copyright (C) 2013 Adrian-Ken Rueegsegger 4 | -- 5 | -- This program is free software: you can redistribute it and/or modify 6 | -- it under the terms of the GNU General Public License as published by 7 | -- the Free Software Foundation, either version 3 of the License, or 8 | -- (at your option) any later version. 9 | -- 10 | -- This program is distributed in the hope that it will be useful, 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | -- GNU General Public License for more details. 14 | -- 15 | -- You should have received a copy of the GNU General Public License 16 | -- along with this program. If not, see . 17 | -- 18 | 19 | with X86_64; 20 | 21 | package Foo.Sender 22 | with 23 | Abstract_State => (State with External => Async_Readers), 24 | Initializes => State 25 | is 26 | 27 | -- Copies the given response message into the response page. 28 | procedure Send (Res : Message_Type) 29 | with 30 | Global => (Output => State, In_Out => X86_64.State), 31 | Depends => (State => Res, X86_64.State =>+ null); 32 | 33 | end Foo.Sender; 34 | -------------------------------------------------------------------------------- /components/time/src/tm-utils.ads: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright (C) 2015 Reto Buerki 3 | -- Copyright (C) 2015 Adrian-Ken Rueegsegger 4 | -- 5 | -- This program is free software: you can redistribute it and/or modify 6 | -- it under the terms of the GNU General Public License as published by 7 | -- the Free Software Foundation, either version 3 of the License, or 8 | -- (at your option) any later version. 9 | -- 10 | -- This program is distributed in the hope that it will be useful, 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | -- GNU General Public License for more details. 14 | -- 15 | -- You should have received a copy of the GNU General Public License 16 | -- along with this program. If not, see . 17 | -- 18 | 19 | with Mutime; 20 | 21 | with Tm.Rtc; 22 | 23 | package Tm.Utils 24 | is 25 | 26 | -- Convert values from CMOS/RTC to Mutime date/time. Outputs error message 27 | -- and returns False if a value does not fulfill the range constraints 28 | -- implied by Mutime. 29 | procedure To_Mutime 30 | (Rtc_Time : Rtc.Time_Type; 31 | Date_Time : out Mutime.Date_Time_Type; 32 | Success : out Boolean); 33 | 34 | end Tm.Utils; 35 | -------------------------------------------------------------------------------- /doc/report/design.tex: -------------------------------------------------------------------------------- 1 | \chapter{Design}\label{chap:design} 2 | The design of the Muen\index{Muen} kernel is based on the concept described in 3 | \cite{TAU0} and inspired by the Common Criteria separation kernel protection 4 | profile (SKPP\index{SKPP}) \cite{SKPP}. The protection profile has been used in 5 | the certification of Green Hills' INTEGRITY-178B kernel and has been retired by 6 | the National Information Assurance Partnership (NIAP) in 2011. Nevertheless we 7 | believe the document can serve as a sound basis and provide guidance to derive 8 | requirements for a separation kernel appropriate for systems requiring high 9 | robustness. 10 | 11 | The separation kernel should allow the construction of systems that could be 12 | exposed to attackers with high potential and deployed in the most difficult 13 | threat environments. 14 | 15 | The first part of the chapter presents what is considered out of scope in the 16 | context of this project. It is followed by the requirements that are at the core 17 | of the kernel design. After that the subject concept is introduced, which is in 18 | turn needed for the presentation of the overall system architecture and the 19 | design of the Muen kernel in section \ref{sec:architecture}. 20 | 21 | \input{des_scope} 22 | \input{des_requirements} 23 | \input{des_subject} 24 | \input{des_architecture} 25 | -------------------------------------------------------------------------------- /components/isolation_tests/isolation_tests.gpr: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright (C) 2021 Reto Buerki 3 | -- Copyright (C) 2021 Adrian-Ken Rueegsegger 4 | -- 5 | -- This program is free software: you can redistribute it and/or modify 6 | -- it under the terms of the GNU General Public License as published by 7 | -- the Free Software Foundation, either version 3 of the License, or 8 | -- (at your option) any later version. 9 | -- 10 | -- This program is distributed in the hope that it will be useful, 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | -- GNU General Public License for more details. 14 | -- 15 | -- You should have received a copy of the GNU General Public License 16 | -- along with this program. If not, see . 17 | -- 18 | 19 | with "libmudebuglog"; 20 | with "libmusinfo"; 21 | with "common_strings"; 22 | 23 | project Isolation_Tests extends "../component_spark" is 24 | 25 | Extra_Dirs := Component_Spark.Src_Dirs; 26 | 27 | for Languages use ("Ada", "Asm"); 28 | for Source_Dirs use (external("GENERATED"), "src", "../src") & Extra_Dirs; 29 | for Object_Dir use "obj/" & Component_Spark.Build_Mode; 30 | for Main use ("isolation_tests"); 31 | 32 | end Isolation_Tests; 33 | -------------------------------------------------------------------------------- /components/sm/src/interrupt_handler.adb: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright (C) 2013-2022 Reto Buerki 3 | -- Copyright (C) 2013-2022 Adrian-Ken Rueegsegger 4 | -- 5 | -- This program is free software: you can redistribute it and/or modify 6 | -- it under the terms of the GNU General Public License as published by 7 | -- the Free Software Foundation, either version 3 of the License, or 8 | -- (at your option) any later version. 9 | -- 10 | -- This program is distributed in the hope that it will be useful, 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | -- GNU General Public License for more details. 14 | -- 15 | -- You should have received a copy of the GNU General Public License 16 | -- along with this program. If not, see . 17 | -- 18 | 19 | package body Interrupt_Handler 20 | is 21 | 22 | ------------------------------------------------------------------------- 23 | 24 | procedure Handle_Interrupt (Context : SK.Exceptions.Isr_Context_Type) 25 | is 26 | begin 27 | 28 | -- The interrupt wakes up the SM moving it past the Hlt instruction, so 29 | -- there is nothing else left to do. 30 | 31 | null; 32 | end Handle_Interrupt; 33 | 34 | end Interrupt_Handler; 35 | -------------------------------------------------------------------------------- /kernel/debug/console/serial/uart/sk-kc.ads: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright (C) 2013, 2015 Reto Buerki 3 | -- Copyright (C) 2013, 2015 Adrian-Ken Rueegsegger 4 | -- 5 | -- This program is free software: you can redistribute it and/or modify 6 | -- it under the terms of the GNU General Public License as published by 7 | -- the Free Software Foundation, either version 3 of the License, or 8 | -- (at your option) any later version. 9 | -- 10 | -- This program is distributed in the hope that it will be useful, 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | -- GNU General Public License for more details. 14 | -- 15 | -- You should have received a copy of the GNU General Public License 16 | -- along with this program. If not, see . 17 | -- 18 | 19 | with SK.Console; 20 | with SK.Console_UART; 21 | 22 | pragma Elaborate (SK.Console); 23 | 24 | --D @Interface 25 | --D Kernel debug console implementation. 26 | --D Note: implementation is only present in debug builds. In release versions 27 | --D this package is empty. 28 | package SK.KC is new SK.Console 29 | (Initialize => Console_UART.Init, 30 | Output_New_Line => Console_UART.New_Line, 31 | Output_Char => Console_UART.Put_Char); 32 | -------------------------------------------------------------------------------- /policy/platform/intel-nuc-6i7kyk.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /policy/xml/smp/subj_sm.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /components/vt/src/mux-screens.ads: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright (C) 2013, 2016 Reto Buerki 3 | -- Copyright (C) 2013, 2016 Adrian-Ken Rueegsegger 4 | -- 5 | -- This program is free software: you can redistribute it and/or modify 6 | -- it under the terms of the GNU General Public License as published by 7 | -- the Free Software Foundation, either version 3 of the License, or 8 | -- (at your option) any later version. 9 | -- 10 | -- This program is distributed in the hope that it will be useful, 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | -- GNU General Public License for more details. 14 | -- 15 | -- You should have received a copy of the GNU General Public License 16 | -- along with this program. If not, see . 17 | -- 18 | 19 | package Mux.Screens 20 | is 21 | 22 | -- Init specified terminal screen. 23 | procedure Init (Screen : Output_Channel_Range); 24 | 25 | -- Update state of terminal screen associated with given input channel 26 | -- index. 27 | procedure Update 28 | (Screen : Output_Channel_Range; 29 | Char : Character); 30 | 31 | -- Activate given terminal screen. 32 | procedure Set_Active (Screen : Output_Channel_Range); 33 | 34 | end Mux.Screens; 35 | -------------------------------------------------------------------------------- /kernel/debug/console/none/sk-kc.ads: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright (C) 2020 Reto Buerki 3 | -- Copyright (C) 2020 Adrian-Ken Rueegsegger 4 | -- 5 | -- This program is free software: you can redistribute it and/or modify 6 | -- it under the terms of the GNU General Public License as published by 7 | -- the Free Software Foundation, either version 3 of the License, or 8 | -- (at your option) any later version. 9 | -- 10 | -- This program is distributed in the hope that it will be useful, 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | -- GNU General Public License for more details. 14 | -- 15 | -- You should have received a copy of the GNU General Public License 16 | -- along with this program. If not, see . 17 | -- 18 | 19 | package SK.KC 20 | is 21 | 22 | -- Initialize console. 23 | procedure Init is null; 24 | 25 | -- Output a new line. 26 | procedure New_Line is null; 27 | 28 | -- Output given character. 29 | procedure Put_Char (Item : Character) is null; 30 | 31 | -- Output given string. 32 | procedure Put_String (Item : String) is null; 33 | 34 | -- Output given string and append a new line. 35 | procedure Put_Line (Item : String) is null; 36 | 37 | end SK.KC; 38 | -------------------------------------------------------------------------------- /policy/xml/subject_vt.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 1 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /components/dbgserver/src/sinks/shmem/enabled/dbg-shared_memory-stream.ads: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright (C) 2018 secunet Security Networks AG 3 | -- 4 | -- This program is free software: you can redistribute it and/or modify 5 | -- it under the terms of the GNU General Public License as published by 6 | -- the Free Software Foundation, either version 3 of the License, or 7 | -- (at your option) any later version. 8 | -- 9 | -- This program is distributed in the hope that it will be useful, 10 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | -- GNU General Public License for more details. 13 | -- 14 | -- You should have received a copy of the GNU General Public License 15 | -- along with this program. If not, see . 16 | -- 17 | 18 | with Muchannel; 19 | with Muchannel_Constants; 20 | 21 | with Dbg.Shared_Memory.Types; 22 | 23 | with Dbgserver_Component.Channels; 24 | 25 | pragma Elaborate_All (Muchannel); 26 | 27 | package Dbg.Shared_Memory.Stream is new Muchannel 28 | (Element_Type => Types.Data_Type, 29 | Elements => 30 | (Dbgserver_Component.Channels.Debug_Shm_Sink_Memory_Size 31 | - Muchannel_Constants.Header_Size) / (Types.Data_Type'Size / 8), 32 | Null_Element => Types.Null_Data, 33 | Protocol => 16#6d3a_cd5d_ced2_3445#); 34 | -------------------------------------------------------------------------------- /components/sm/src/exit_handlers-rdmsr.ads: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright (C) 2013, 2014, 2016 Reto Buerki 3 | -- Copyright (C) 2013, 2014, 2016 Adrian-Ken Rueegsegger 4 | -- 5 | -- This program is free software: you can redistribute it and/or modify 6 | -- it under the terms of the GNU General Public License as published by 7 | -- the Free Software Foundation, either version 3 of the License, or 8 | -- (at your option) any later version. 9 | -- 10 | -- This program is distributed in the hope that it will be useful, 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | -- GNU General Public License for more details. 14 | -- 15 | -- You should have received a copy of the GNU General Public License 16 | -- along with this program. If not, see . 17 | -- 18 | 19 | with Subject_Info; 20 | with Types; 21 | 22 | package Exit_Handlers.RDMSR 23 | is 24 | 25 | use type Types.Subject_Action_Type; 26 | 27 | -- Emulate read operation of MSR. 28 | procedure Process (Action : out Types.Subject_Action_Type) 29 | with 30 | Global => (In_Out => Subject_Info.State), 31 | Depends => (Subject_Info.State =>+ null, Action => null), 32 | Post => Action = Types.Subject_Continue; 33 | 34 | end Exit_Handlers.RDMSR; 35 | -------------------------------------------------------------------------------- /components/time/src/tm-main.ads: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright (C) 2015 Reto Buerki 3 | -- Copyright (C) 2015 Adrian-Ken Rueegsegger 4 | -- 5 | -- This program is free software: you can redistribute it and/or modify 6 | -- it under the terms of the GNU General Public License as published by 7 | -- the Free Software Foundation, either version 3 of the License, or 8 | -- (at your option) any later version. 9 | -- 10 | -- This program is distributed in the hope that it will be useful, 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | -- GNU General Public License for more details. 14 | -- 15 | -- You should have received a copy of the GNU General Public License 16 | -- along with this program. If not, see . 17 | -- 18 | 19 | with X86_64; 20 | 21 | with Musinfo.Instance; 22 | 23 | with Mucontrol.Status.Instance; 24 | 25 | with Debuglog.Client; 26 | 27 | with Tm.Publish; 28 | 29 | package Tm.Main 30 | is 31 | 32 | -- Run. 33 | procedure Run 34 | with 35 | Global => (Input => Musinfo.Instance.State, 36 | In_Out => (Publish.State, Mucontrol.Status.Instance.State, 37 | X86_64.State), 38 | Output => Debuglog.Client.State); 39 | 40 | end Tm.Main; 41 | -------------------------------------------------------------------------------- /doc/report/graph_mp_overview.tex: -------------------------------------------------------------------------------- 1 | \begin{tikzpicture} 2 | \node[greenbox, minimum width=7.5cm] (mem) {System Memory}; 3 | 4 | % SK 0 5 | \node[graybox, minimum width=2.3cm, below=1cm of mem.south west, anchor=north west] (pc1) {CPU storage}; 6 | \node[graybox, minimum width=2.3cm, below=1mm of pc1] (st1) {Stack}; 7 | \node[above=2mm of pc1] (mu1) {Muen SK}; 8 | \begin{pgfonlayer}{background} 9 | \node[bluebox, minimum width=2.5cm, minimum height=1.7cm] (mb1) [fit = (pc1) (st1) (mu1)] {}; 10 | \end{pgfonlayer} 11 | 12 | \node[apribox, minimum width=2.5cm, below=5mm of mb1, label=below:\emph{BSP}] (cp1) {CPU0}; 13 | 14 | \draw[arrow, gray] (mb1) to node[auto, gray] {LAPIC} (cp1); 15 | 16 | % SK 1 17 | \node[graybox, minimum width=2.3cm, below=1cm of mem.south east, anchor=north east] (pc2) {CPU storage}; 18 | \node[graybox, minimum width=2.3cm, below=1mm of pc2] (st2) {Stack}; 19 | \node[above=2mm of pc2] (mu2) {Muen SK}; 20 | \begin{pgfonlayer}{background} 21 | \node[bluebox, minimum width=2.5cm, minimum height=1.7cm] (mb2) [fit = (pc2) (st2) (mu2)] {}; 22 | \end{pgfonlayer} 23 | 24 | \node[apribox, minimum width=2.5cm, below=5mm of mb2, label=below:\emph{AP}] (cp2) {CPU1}; 25 | 26 | \draw[arrow, gray] (cp2) to node[auto, gray] {LAPIC} (mb2); 27 | 28 | % Inter-core 29 | \draw[arrow, gray] (mb1) to node[gray, auto] {INIT-SIPI-SIPI} (mb2); 30 | \end{tikzpicture} 31 | -------------------------------------------------------------------------------- /components/dbgserver/src/sinks/xhcidbg/dbg-xhci_dbg.ads: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright (C) 2016 secunet Security Networks AG 3 | -- 4 | -- This program is free software: you can redistribute it and/or modify 5 | -- it under the terms of the GNU General Public License as published by 6 | -- the Free Software Foundation, either version 3 of the License, or 7 | -- (at your option) any later version. 8 | -- 9 | -- This program is distributed in the hope that it will be useful, 10 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | -- GNU General Public License for more details. 13 | -- 14 | -- You should have received a copy of the GNU General Public License 15 | -- along with this program. If not, see . 16 | -- 17 | 18 | with Dbg.Byte_Queue; 19 | with Dbg.Consoles; 20 | 21 | private package Dbg.Xhci_Dbg 22 | is 23 | 24 | -- Init xHCI debug capability. 25 | procedure Init; 26 | 27 | -- Read bytes from the xHCI debug capability into the input queue and 28 | -- output bytes from the output queue and the console to the xHCI debug 29 | -- line. 30 | procedure Run 31 | (Console : in out Consoles.Console_Type; 32 | Input_Queue : in out Byte_Queue.Queue_Type; 33 | Output_Queue : in out Byte_Queue.Queue_Type); 34 | 35 | end Dbg.Xhci_Dbg; 36 | -------------------------------------------------------------------------------- /kernel/debug/sk-subjects-debug.ads: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright (C) 2016 Reto Buerki 3 | -- Copyright (C) 2016 Adrian-Ken Rueegsegger 4 | -- 5 | -- This program is free software: you can redistribute it and/or modify 6 | -- it under the terms of the GNU General Public License as published by 7 | -- the Free Software Foundation, either version 3 of the License, or 8 | -- (at your option) any later version. 9 | -- 10 | -- This program is distributed in the hope that it will be useful, 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | -- GNU General Public License for more details. 14 | -- 15 | -- You should have received a copy of the GNU General Public License 16 | -- along with this program. If not, see . 17 | -- 18 | 19 | with SK.Crash_Audit_Types; 20 | 21 | --D @Interface 22 | --D Utility package providing helper function for printing subject state debug 23 | --D information. 24 | --D Note: implementation is only present in debug builds. In release versions 25 | --D this package is empty. 26 | package SK.Subjects.Debug 27 | with 28 | SPARK_Mode => Off 29 | is 30 | 31 | -- Print state information of given subject. 32 | procedure Print_State (S : Crash_Audit_Types.Subj_Context_Type); 33 | 34 | end SK.Subjects.Debug; 35 | -------------------------------------------------------------------------------- /policy/xml/subject_example.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "build-cfg"] 2 | path = build-cfg 3 | url = ../muen/build-cfg.git 4 | [submodule "components/linux/src"] 5 | path = components/linux/src 6 | url = ../muen/linux.git 7 | [submodule "components/libxhcidbg"] 8 | path = components/libxhcidbg 9 | url = ../libxhcidbg.git 10 | branch = muen 11 | [submodule "components/tau0-static"] 12 | path = components/tau0-static 13 | url = ../muen/tau0.git 14 | [submodule "components/linux/modules/muenfs"] 15 | path = components/linux/modules/muenfs 16 | url = ../muen/linux/muenfs.git 17 | [submodule "components/linux/modules/muennet"] 18 | path = components/linux/modules/muennet 19 | url = ../muen/linux/muennet.git 20 | [submodule "components/linux/modules/muenblock"] 21 | path = components/linux/modules/muenblock 22 | url = ../muen/linux/muenblock.git 23 | [submodule "components/linux/modules/muenevents"] 24 | path = components/linux/modules/muenevents 25 | url = ../muen/linux/muenevents.git 26 | [submodule "tools"] 27 | path = tools 28 | url = ../muen/tools.git 29 | [submodule "contrib"] 30 | path = contrib 31 | url = ../muen/contrib.git 32 | [submodule "common"] 33 | path = common 34 | url = ../muen/common.git 35 | [submodule "rts"] 36 | path = rts 37 | url = ../muen/rts.git 38 | [submodule "nci"] 39 | path = ci/nci 40 | url = ../nci.git 41 | [submodule "nci-config"] 42 | path = ci/nci-config 43 | url = ../nci-config.git 44 | -------------------------------------------------------------------------------- /components/sm/src/exit_handlers-wrmsr.ads: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright (C) 2013, 2014, 2016 Reto Buerki 3 | -- Copyright (C) 2013, 2014, 2016 Adrian-Ken Rueegsegger 4 | -- 5 | -- This program is free software: you can redistribute it and/or modify 6 | -- it under the terms of the GNU General Public License as published by 7 | -- the Free Software Foundation, either version 3 of the License, or 8 | -- (at your option) any later version. 9 | -- 10 | -- This program is distributed in the hope that it will be useful, 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | -- GNU General Public License for more details. 14 | -- 15 | -- You should have received a copy of the GNU General Public License 16 | -- along with this program. If not, see . 17 | -- 18 | 19 | with Types; 20 | with Subject_Info; 21 | 22 | package Exit_Handlers.WRMSR 23 | is 24 | 25 | use type Types.Subject_Action_Type; 26 | 27 | -- Emulate MSR write operation. 28 | procedure Process (Action : out Types.Subject_Action_Type) 29 | with 30 | Global => (Input => Subject_Info.State), 31 | Depends => (Action => null, 32 | null => Subject_Info.State), 33 | Post => Action = Types.Subject_Continue; 34 | 35 | end Exit_Handlers.WRMSR; 36 | -------------------------------------------------------------------------------- /kernel/debug/console/vga/sk-legacy_vga.ads: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright (C) 2020 Reto Buerki 3 | -- Copyright (C) 2020 Adrian-Ken Rueegsegger 4 | -- 5 | -- This program is free software: you can redistribute it and/or modify 6 | -- it under the terms of the GNU General Public License as published by 7 | -- the Free Software Foundation, either version 3 of the License, or 8 | -- (at your option) any later version. 9 | -- 10 | -- This program is distributed in the hope that it will be useful, 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | -- GNU General Public License for more details. 14 | -- 15 | -- You should have received a copy of the GNU General Public License 16 | -- along with this program. If not, see . 17 | -- 18 | 19 | with Skp.Hardware; 20 | 21 | with SK.Console_VGA; 22 | 23 | package SK.Legacy_VGA 24 | is 25 | 26 | type Width_Type is range 1 .. 80; 27 | type Height_Type is range 1 .. 25; 28 | 29 | VGA_Buffer_Offset : constant SK.Word64 := 16#1_8000#; 30 | 31 | package VGA is new Console_VGA 32 | (Width_Type => Width_Type, 33 | Height_Type => Height_Type, 34 | Base_Address => Skp.Hardware.Debugconsole_Memory + VGA_Buffer_Offset, 35 | Cursor_Offset => 0); 36 | 37 | end SK.Legacy_VGA; 38 | -------------------------------------------------------------------------------- /kernel/doc/graph_spark.tex: -------------------------------------------------------------------------------- 1 | \begin{tikzpicture} 2 | \tikzstyle{box}=[whitebox, draw, dropshadow, fill=white, text width=2.5cm, text centered] 3 | \tikzstyle{rbox}=[whitebox, draw, dropshadow, fill=white, rounded corners, minimum height=1cm] 4 | \tikzstyle{colorbox}=[commonnode, bottom color=guestcolor, text width=2.5cm, text centered] 5 | 6 | \node[colorbox] (src) at (0,0) {Source Files (\texttt{*.ads, *.adb})}; 7 | \node[rbox] (gnat) at (3,0) {GNATprove}; 8 | \node[box] (mlw) at (6,0) {Why3 Files \\ (\texttt{*.mlw})}; 9 | \node[rbox] (why) at (9,0) {Why3}; 10 | \node[box] (iwhyf) at (9,-1.5) {Isabelle-Why3 \\ Files (\texttt{*.xml})}; 11 | \node[box] (altf) at (9,1.5) {SMT Files}; 12 | \node[rbox, text width=2.25cm, text centered] (iwhyw) at (6,-1.5) {Isabelle-Why3 \\ Wrapper}; 13 | \node[rbox] (alt) at (6,1.5) {SMT Solver}; 14 | \node[colorbox, text width=2.25cm] (thy) at (3,-1.5) {Theory Files \\ (\texttt{*.thy})}; 15 | \node[rbox] (iwhy) at (0,-1.5) {Isabelle-Why3}; 16 | 17 | \draw[-latex] (src) -- (gnat); 18 | \draw[-latex] (gnat) -- (mlw); 19 | \draw[-latex] (mlw) -- (why); 20 | \draw[-latex] (why) -- (iwhyf); 21 | \draw[-latex] (why) -- (altf); 22 | \draw[-latex] (iwhyf) -- (iwhyw); 23 | \draw[-latex] (altf) -- (alt); 24 | \draw[-latex] (iwhyw) -- (thy); 25 | \draw[-latex] (thy) -- (iwhy); 26 | \draw[-latex] (iwhyf) .. controls (7,-3) and (2,-3) .. (iwhy); 27 | \end{tikzpicture} 28 | -------------------------------------------------------------------------------- /components/dbgserver/src/sinks/serial/dbg-serial.ads: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright (C) 2014 secunet Security Networks AG 3 | -- 4 | -- This program is free software: you can redistribute it and/or modify 5 | -- it under the terms of the GNU General Public License as published by 6 | -- the Free Software Foundation, either version 3 of the License, or 7 | -- (at your option) any later version. 8 | -- 9 | -- This program is distributed in the hope that it will be useful, 10 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | -- GNU General Public License for more details. 13 | -- 14 | -- You should have received a copy of the GNU General Public License 15 | -- along with this program. If not, see . 16 | -- 17 | 18 | with Dbg.Byte_Queue; 19 | with Dbg.Consoles; 20 | 21 | private package Dbg.Serial 22 | is 23 | 24 | -- Init serial line. 25 | procedure Init; 26 | 27 | -- Read bytes from the serial line into the input queue and output bytes 28 | -- from the output queue and the console to the serial line. 29 | procedure Run 30 | (Console : in out Consoles.Console_Type; 31 | Input_Queue : in out Byte_Queue.Queue_Type; 32 | Output_Queue : in out Byte_Queue.Queue_Type); 33 | 34 | private 35 | 36 | FIFO_Size : constant := 16; 37 | 38 | end Dbg.Serial; 39 | -------------------------------------------------------------------------------- /components/dbgserver/misc/gpr.xsl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /kernel/debug/console/serial/hsuart/sk-uart_pkg.ads: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright (C) 2015 Reto Buerki 3 | -- Copyright (C) 2015 Adrian-Ken Rueegsegger 4 | -- 5 | -- This program is free software: you can redistribute it and/or modify 6 | -- it under the terms of the GNU General Public License as published by 7 | -- the Free Software Foundation, either version 3 of the License, or 8 | -- (at your option) any later version. 9 | -- 10 | -- This program is distributed in the hope that it will be useful, 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | -- GNU General Public License for more details. 14 | -- 15 | -- You should have received a copy of the GNU General Public License 16 | -- along with this program. If not, see . 17 | -- 18 | 19 | with Skp.Hardware; 20 | 21 | with SK.UART; 22 | with SK.UART_HS; 23 | 24 | package SK.UART_Pkg is new UART 25 | (Base_Address => Skp.Hardware.Debugconsole_Memory, 26 | Register_Type => Word32, 27 | Address_Type => Word64, 28 | UART_DLL => 0, 29 | UART_DLH => 4, 30 | UART_IER => 4, 31 | UART_FCR => 8, 32 | UART_LCR => 16#0c#, 33 | UART_MCR => 16#10#, 34 | UART_LSR => 16#14#, 35 | Read => UART_HS.Read, 36 | Write => UART_HS.Write); 37 | -------------------------------------------------------------------------------- /kernel/debug/console/serial/sk-console_serial.ads: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright (C) 2015 Reto Buerki 3 | -- Copyright (C) 2015 Adrian-Ken Rueegsegger 4 | -- 5 | -- This program is free software: you can redistribute it and/or modify 6 | -- it under the terms of the GNU General Public License as published by 7 | -- the Free Software Foundation, either version 3 of the License, or 8 | -- (at your option) any later version. 9 | -- 10 | -- This program is distributed in the hope that it will be useful, 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | -- GNU General Public License for more details. 14 | -- 15 | -- You should have received a copy of the GNU General Public License 16 | -- along with this program. If not, see . 17 | -- 18 | 19 | with SK.UART; 20 | private with SK.Constants; 21 | 22 | generic 23 | 24 | with package UART_Pkg is new SK.UART (<>); 25 | 26 | package SK.Console_Serial 27 | is 28 | -- Init UART. 29 | procedure Init; 30 | 31 | -- Write newline. 32 | procedure New_Line; 33 | 34 | -- Write character. 35 | procedure Put_Char (Item : Character); 36 | 37 | private 38 | 39 | State : UART_Pkg.State_Type 40 | with 41 | Linker_Section => Constants.Global_Data_Section; 42 | 43 | end SK.Console_Serial; 44 | -------------------------------------------------------------------------------- /components/example/src/exceptions.ads: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright (C) 2022 Reto Buerki 3 | -- Copyright (C) 2022 Adrian-Ken Rueegsegger 4 | -- 5 | -- This program is free software: you can redistribute it and/or modify 6 | -- it under the terms of the GNU General Public License as published by 7 | -- the Free Software Foundation, either version 3 of the License, or 8 | -- (at your option) any later version. 9 | -- 10 | -- This program is distributed in the hope that it will be useful, 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | -- GNU General Public License for more details. 14 | -- 15 | -- You should have received a copy of the GNU General Public License 16 | -- along with this program. If not, see . 17 | -- 18 | 19 | with Interfaces; 20 | 21 | with Musinfo.Instance; 22 | 23 | package Exceptions 24 | is 25 | 26 | -- Trigger breakpoint exception (vector number 3). 27 | procedure Trigger_Breakpoint; 28 | 29 | -- Print backtrace of System V ABI 64-bit call stack with given RBP value. 30 | procedure Print_Backtrace 31 | (RIP : Interfaces.Unsigned_64; 32 | RBP : Interfaces.Unsigned_64) 33 | with 34 | Pre => Musinfo.Instance.Is_Valid; 35 | 36 | BP_Triggered : Boolean 37 | with Volatile; 38 | 39 | end Exceptions; 40 | --------------------------------------------------------------------------------