├── .github ├── FUNDING.yml └── workflows │ ├── check-clippy.yaml │ ├── docs.yaml │ └── test.yaml ├── .gitignore ├── .gitmodules ├── Cargo.lock ├── Cargo.toml ├── LICENSE-MIT ├── Makefile ├── README.md ├── applications ├── .old_static_binary_hello │ ├── Cargo.toml │ ├── Makefile │ └── src │ │ └── main.rs ├── bm │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── cat │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── cd │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── channel_eval │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── date │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── deps │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── example │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── heap_eval │ ├── Cargo.toml │ └── src │ │ ├── lib.rs │ │ ├── shbench.rs │ │ └── threadtest.rs ├── hello │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── hull │ ├── Cargo.toml │ └── src │ │ ├── builtin.rs │ │ ├── error.rs │ │ ├── job.rs │ │ ├── lib.rs │ │ ├── parse.rs │ │ └── wrapper.rs ├── kill │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── less │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── loadc │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── ls │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── lspci │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── mkdir │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── ns │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── ping │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── pmu_sample_start │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── pmu_sample_stop │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── print_fault_log │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── ps │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── pwd │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── qemu_test │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── raw_mode │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── rm │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── rq │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── rq_eval │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── scheduler_eval │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── seconds_counter │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── serial_echo │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── shell │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── swap │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── test_aligned_page_allocation │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── test_async │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── test_backtrace │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── test_block_io │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── test_channel │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── test_filerw │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── test_identity_mapping │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── test_ixgbe │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── test_libc │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── test_mlx5 │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── test_panic │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── test_preemption_counter │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── test_restartable │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── test_scheduler │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── test_std_fs │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── test_sync_block │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── test_task_cancel │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── test_tls │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── test_wait_queue │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── test_wasmtime │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── unwind_test │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── upd │ ├── Cargo.toml │ └── src │ │ └── lib.rs └── wasm │ ├── Cargo.toml │ └── src │ └── lib.rs ├── bochsrc.txt ├── book ├── .gitignore ├── README.md ├── book.toml ├── cspell.json └── src │ ├── SUMMARY.md │ ├── app │ └── app.md │ ├── building │ ├── building.md │ ├── configuration.md │ └── rust_builds_out_of_tree.md │ ├── c │ ├── compiler_linker.md │ ├── cross_compiler.md │ ├── programs.md │ └── tlibc.md │ ├── contribute │ ├── contribute.md │ └── git.md │ ├── design │ ├── booting.md │ ├── design.md │ ├── idea.md │ ├── intralingual.md │ └── source_code_organization.md │ ├── images │ ├── boot_image.svg │ ├── cell_consistency.svg │ ├── kernel_structure.svg │ └── metadata_tree.svg │ ├── index.md │ ├── misc │ ├── crate_namespaces.md │ ├── papers_presentations.md │ └── quick_start.md │ ├── running │ ├── headless.md │ ├── pxe.md │ ├── running.md │ ├── usb.md │ └── virtual_machine │ │ ├── pci_passthrough.md │ │ └── virtual_machine.md │ └── subsystems │ ├── display │ ├── display.md │ ├── window_manager.md │ └── window_tutorial.md │ ├── heap.md │ ├── memory.md │ ├── memory_mapping.md │ ├── subsystems.md │ ├── task.md │ └── task_invariants.md ├── c_test ├── Makefile ├── dummy.c └── print_test.c ├── cfg ├── Config.mk ├── README.md ├── aarch64-unknown-theseus.json ├── limine.cfg ├── partial_linking_combine_sections.ld ├── x86_64-unknown-theseus-avx.json ├── x86_64-unknown-theseus-sse.json └── x86_64-unknown-theseus.json ├── compiler_plugins ├── Cargo.lock ├── Cargo.toml └── application_main_fn.rs ├── docker ├── Dockerfile ├── build_docker.sh ├── install_docker_ubuntu.sh └── run_docker.sh ├── extra_files ├── README.md ├── test_files │ ├── text │ │ ├── a_new_hope.txt │ │ ├── attack_of_the_clones.txt │ │ ├── return_of_the_jedi.txt │ │ ├── revenge_of_the_sith.txt │ │ ├── the_empire_strikes_back.txt │ │ ├── the_force_awakens.txt │ │ ├── the_last_jedi.txt │ │ ├── the_phantom_menace.txt │ │ └── the_rise_of_skywalker.txt │ └── zork_dat │ │ └── dtextc.dat └── wasm │ ├── exorbitant.wasm │ ├── grep.wasm │ ├── hello.cwasm │ ├── pee.wasm │ └── zork.wasm ├── github_pages ├── .gitignore ├── README.md └── index.html ├── kernel ├── _doc_root.rs ├── acpi │ ├── Cargo.toml │ ├── acpi_table │ │ ├── Cargo.toml │ │ └── src │ │ │ └── lib.rs │ ├── acpi_table_handler │ │ ├── Cargo.toml │ │ └── src │ │ │ └── lib.rs │ ├── dmar │ │ ├── Cargo.toml │ │ └── src │ │ │ ├── device_scope.rs │ │ │ ├── drhd.rs │ │ │ └── lib.rs │ ├── fadt │ │ ├── Cargo.toml │ │ └── src │ │ │ └── lib.rs │ ├── hpet │ │ ├── Cargo.toml │ │ └── src │ │ │ └── lib.rs │ ├── madt │ │ ├── Cargo.toml │ │ └── src │ │ │ └── lib.rs │ ├── rsdp │ │ ├── Cargo.toml │ │ └── src │ │ │ └── lib.rs │ ├── rsdt │ │ ├── Cargo.toml │ │ └── src │ │ │ └── lib.rs │ ├── sdt │ │ ├── Cargo.toml │ │ └── src │ │ │ └── lib.rs │ ├── src │ │ └── lib.rs │ └── waet │ │ ├── Cargo.toml │ │ └── src │ │ └── lib.rs ├── ap_start │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── apic │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── app_io │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── arm_boards │ ├── Cargo.toml │ └── src │ │ ├── boards │ │ ├── qemu_virt.rs │ │ └── unselected.rs │ │ ├── lib.rs │ │ └── mpidr.rs ├── ata │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── block_allocator │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── block_cache │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── boot_info │ ├── Cargo.toml │ └── src │ │ ├── lib.rs │ │ ├── multiboot2.rs │ │ └── uefi.rs ├── bootloader_modules │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── captain │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── catch_unwind │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── cls │ ├── Cargo.toml │ ├── cls_macros │ │ ├── Cargo.toml │ │ └── src │ │ │ ├── int.rs │ │ │ └── lib.rs │ └── src │ │ └── lib.rs ├── cls_allocator │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── color │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── compositor │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── console │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── context_switch │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── context_switch_avx │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── context_switch_regular │ ├── Cargo.toml │ └── src │ │ ├── aarch64.rs │ │ ├── lib.rs │ │ └── x86_64.rs ├── context_switch_sse │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── cpu │ ├── Cargo.toml │ └── src │ │ ├── aarch64.rs │ │ ├── lib.rs │ │ └── x86_64.rs ├── crate_metadata │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── crate_metadata_serde │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── crate_name_utils │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── crate_swap │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── debug_info │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── deferred_interrupt_tasks │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── device_manager │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── displayable │ ├── Cargo.toml │ ├── src │ │ └── lib.rs │ └── text_display │ │ ├── Cargo.toml │ │ └── src │ │ └── lib.rs ├── dreadnought │ ├── Cargo.toml │ └── src │ │ ├── lib.rs │ │ ├── task.rs │ │ └── time.rs ├── e1000 │ ├── Cargo.toml │ └── src │ │ ├── lib.rs │ │ ├── regs.rs │ │ └── test_e1000_driver.rs ├── early_printer │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── early_tls │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── environment │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── event_types │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── exceptions_early │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── exceptions_full │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── external_unwind_info │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── fault_crate_swap │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── fault_log │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── first_application │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── font │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── frame_allocator │ ├── Cargo.toml │ └── src │ │ ├── lib.rs │ │ ├── static_array_linked_list.rs │ │ ├── static_array_rb_tree.rs │ │ └── test.rs ├── framebuffer │ ├── Cargo.toml │ └── src │ │ ├── lib.rs │ │ └── pixel.rs ├── framebuffer_compositor │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── framebuffer_drawer │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── framebuffer_printer │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── fs_node │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── gdt │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── generic_timer_aarch64 │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── gic │ ├── Cargo.toml │ └── src │ │ ├── gic │ │ ├── cpu_interface_gicv2.rs │ │ ├── cpu_interface_gicv3.rs │ │ ├── dist_interface.rs │ │ ├── mod.rs │ │ └── redist_interface.rs │ │ └── lib.rs ├── heap │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── heapfile │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── http_client │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── idle │ ├── Cargo.toml │ └── src │ │ ├── arch │ │ ├── mod.rs │ │ └── x86_64 │ │ │ ├── intel.rs │ │ │ └── mod.rs │ │ └── lib.rs ├── intel_ethernet │ ├── Cargo.toml │ └── src │ │ ├── descriptors.rs │ │ └── lib.rs ├── interrupt_controller │ ├── Cargo.toml │ └── src │ │ ├── aarch64.rs │ │ ├── lib.rs │ │ └── x86_64.rs ├── interrupts │ ├── Cargo.toml │ └── src │ │ ├── aarch64 │ │ ├── mod.rs │ │ └── table.s │ │ ├── lib.rs │ │ ├── macro-doc.md │ │ └── x86_64 │ │ ├── mod.rs │ │ └── rtc.rs ├── io │ ├── Cargo.toml │ └── src │ │ ├── lib.rs │ │ └── test.rs ├── ioapic │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── iommu │ ├── Cargo.toml │ └── src │ │ ├── lib.rs │ │ └── regs.rs ├── ixgbe │ ├── Cargo.toml │ └── src │ │ ├── lib.rs │ │ ├── queue_registers.rs │ │ ├── regs.rs │ │ ├── test_packets.rs │ │ └── virtual_function.rs ├── kernel_config │ ├── Cargo.toml │ └── src │ │ ├── display.rs │ │ ├── lib.rs │ │ ├── memory.rs │ │ └── time.rs ├── keyboard │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── libterm │ ├── Cargo.toml │ └── src │ │ ├── cursor.rs │ │ └── lib.rs ├── libtest │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── local_storage_initializer │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── logger │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── memfs │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── memory │ ├── Cargo.toml │ └── src │ │ ├── lib.rs │ │ └── paging │ │ ├── mapper.rs │ │ ├── mod.rs │ │ ├── table.rs │ │ └── temporary_page.rs ├── memory_aarch64 │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── memory_initialization │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── memory_structs │ ├── Cargo.toml │ └── src │ │ ├── lib.rs │ │ └── test.rs ├── memory_x86_64 │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── mlx5 │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── mlx_ethernet │ ├── Cargo.toml │ └── src │ │ ├── command_queue.rs │ │ ├── completion_queue.rs │ │ ├── event_queue.rs │ │ ├── flow_table.rs │ │ ├── initialization_segment.rs │ │ ├── lib.rs │ │ ├── receive_queue.rs │ │ ├── send_queue.rs │ │ ├── uar.rs │ │ └── work_queue.rs ├── mod_mgmt │ ├── Cargo.toml │ └── src │ │ ├── lib.rs │ │ ├── parse_nano_core.rs │ │ ├── replace_nano_core_crates.rs │ │ └── serde.rs ├── mouse │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── multicore_bringup │ ├── Cargo.toml │ └── src │ │ ├── aarch64.rs │ │ ├── lib.rs │ │ └── x86_64.rs ├── multiple_heaps │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── nano_core │ ├── Cargo.toml │ ├── build.rs │ ├── linker_higher_half-aarch64.ld │ ├── linker_higher_half-x86_64.ld │ └── src │ │ ├── asm │ │ ├── ap_boot.asm │ │ ├── ap_realmode.asm │ │ ├── bios │ │ │ ├── boot.asm │ │ │ └── multiboot_header.asm │ │ ├── common.asm │ │ └── defines.asm │ │ ├── bios.rs │ │ ├── lib.rs │ │ ├── libm.rs │ │ ├── stack_smash_protection.rs │ │ └── uefi.rs ├── net │ ├── Cargo.toml │ └── src │ │ ├── device.rs │ │ ├── interface.rs │ │ ├── lib.rs │ │ └── socket.rs ├── nic_buffers │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── nic_initialization │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── nic_queues │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── no_drop │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── ota_update_client │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── page_allocator │ ├── Cargo.toml │ └── src │ │ ├── lib.rs │ │ ├── static_array_linked_list.rs │ │ └── static_array_rb_tree.rs ├── page_attribute_table │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── page_table_entry │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── panic_entry │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── panic_wrapper │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── path │ ├── Cargo.toml │ └── src │ │ ├── component.rs │ │ └── lib.rs ├── pci │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── physical_nic │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── pic │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── pit_clock │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── pit_clock_basic │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── pmu_x86 │ ├── Cargo.toml │ └── src │ │ ├── lib.rs │ │ └── stat.rs ├── preemption │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── ps2 │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── pte_flags │ ├── Cargo.toml │ └── src │ │ ├── lib.rs │ │ ├── pte_flags_aarch64.rs │ │ └── pte_flags_x86_64.rs ├── random │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── rendezvous │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── root │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── rtc │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── scheduler │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── scheduler_epoch │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── scheduler_priority │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── scheduler_round_robin │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── serial_port │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── serial_port_basic │ ├── Cargo.toml │ └── src │ │ ├── aarch64.rs │ │ ├── lib.rs │ │ └── x86_64.rs ├── shapes │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── signal_handler │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── simd_personality │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── simd_test │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── simple_ipc │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── single_simd_task_optimization │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── slabmalloc │ ├── Cargo.toml │ └── src │ │ ├── lib.rs │ │ ├── pages.rs │ │ ├── sc.rs │ │ └── zone.rs ├── slabmalloc_safe │ ├── Cargo.toml │ └── src │ │ ├── lib.rs │ │ ├── pages.rs │ │ ├── sc.rs │ │ └── zone.rs ├── slabmalloc_unsafe │ ├── Cargo.toml │ └── src │ │ ├── lib.rs │ │ ├── pages.rs │ │ ├── sc.rs │ │ └── zone.rs ├── sleep │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── spawn │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── stack │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── stack_trace │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── stack_trace_frame_pointers │ ├── Cargo.toml │ ├── build.rs │ └── src │ │ └── lib.rs ├── state_store │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── storage_device │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── storage_manager │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── sync_block │ ├── Cargo.toml │ └── src │ │ ├── condvar.rs │ │ ├── lib.rs │ │ └── std_api.rs ├── sync_channel │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── sync_preemption │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── task │ ├── Cargo.toml │ └── src │ │ ├── lib.rs │ │ └── scheduler.rs ├── task_fs │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── task_struct │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── test_thread_local │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── text_terminal │ ├── Cargo.toml │ └── src │ │ ├── ansi_colors.rs │ │ ├── ansi_style.rs │ │ └── lib.rs ├── thread_local_macro │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── time │ ├── Cargo.toml │ └── src │ │ ├── dummy.rs │ │ └── lib.rs ├── tlb_shootdown │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── tsc │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── tss │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── tty │ ├── Cargo.toml │ └── src │ │ ├── channel.rs │ │ ├── discipline.rs │ │ └── lib.rs ├── uart_pl011 │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── unified_channel │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── unwind │ ├── Cargo.toml │ └── src │ │ ├── lib.rs │ │ ├── lsda.rs │ │ └── registers.rs ├── vfs_node │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── vga_buffer │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── virtual_nic │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── wait_condition │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── wait_guard │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── wait_queue │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── waker │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── waker_generic │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── wasi_interpreter │ ├── Cargo.toml │ └── src │ │ ├── lib.rs │ │ ├── posix_file_system.rs │ │ ├── wasi_definitions.rs │ │ ├── wasi_syscalls.rs │ │ └── wasmi_state_machine.rs ├── window │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── window_inner │ ├── Cargo.toml │ └── src │ │ └── lib.rs └── window_manager │ ├── Cargo.toml │ └── src │ └── lib.rs ├── libs ├── README.md ├── atomic_linked_list │ ├── Cargo.toml │ └── src │ │ ├── atomic_linked_list.rs │ │ ├── atomic_map.rs │ │ └── lib.rs ├── cow_arc │ ├── .gitignore │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── debugit │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── dereffer │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── keycodes_ascii │ ├── .gitignore │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── lockable │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── locked_idt │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── mouse_data │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── mpmc_queue │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── msr │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── owned_borrowed_trait │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── percent_encoding │ ├── Cargo.toml │ ├── LICENSE-APACHE │ ├── LICENSE-MIT │ └── lib.rs ├── port_io │ ├── .gitignore │ ├── Cargo.toml │ └── src │ │ ├── lib.rs │ │ └── x86.rs ├── range_inclusive │ ├── .gitignore │ ├── Cargo.toml │ └── src │ │ ├── lib.rs │ │ └── test.rs ├── stdio │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── str_ref │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── sync │ ├── Cargo.toml │ └── src │ │ ├── lib.rs │ │ ├── mutex.rs │ │ └── rw_lock.rs ├── sync_irq │ ├── Cargo.toml │ └── src │ │ └── lib.rs └── sync_spin │ ├── Cargo.toml │ └── src │ └── lib.rs ├── libtheseus ├── Cargo.lock ├── Cargo.toml ├── build.sh └── src │ ├── lib.rs │ └── my_mod.rs ├── old_crates ├── dbus │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── immediate_input_echo │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── input_echo │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── keyboard_echo │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── less │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── mapper │ └── unsized_as_type.rs ├── spawn_userspace │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── state_transfer │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── syscall │ ├── Cargo.toml │ └── src │ │ └── lib.rs └── userspace │ ├── Makefile │ ├── simple_test │ ├── Makefile │ └── test_program.s │ └── syscall_test │ ├── Makefile │ ├── syscall_receive.s │ └── syscall_send.s ├── ports ├── README.md └── theseus_std │ ├── Cargo.toml │ └── src │ ├── env.rs │ ├── fs.rs │ ├── fs_imp.rs │ ├── lib.rs │ ├── os_str.rs │ ├── os_str_imp.rs │ ├── path.rs │ └── sys_common.rs ├── rust-toolchain.toml ├── rustfmt.toml ├── scripts ├── bridge_host_tap.sh ├── build_server.sh ├── elfdiff.sh ├── find_simd_instr.sh ├── graph.sh ├── install_x86_64-elf-gcc.sh ├── mac_os_build_setup.sh ├── objdiff.sh ├── objlist.sh └── test_simple_tap.sh ├── slirp.conf ├── theseus_features ├── Cargo.toml └── src │ └── lib.rs ├── tlibc ├── .gitignore ├── Cargo.lock ├── Cargo.toml ├── README.md ├── build.rs ├── build.sh ├── include │ ├── stdarg.h │ ├── stddef.h │ ├── stdint.h │ ├── stdio.h │ ├── string.h │ ├── strings.h │ └── sys │ │ └── mman.h └── src │ ├── c_wrappers │ └── stdio.c │ ├── errno.rs │ ├── globals.rs │ ├── io.rs │ ├── lib.rs │ ├── mm.rs │ ├── stdio │ ├── mod.rs │ └── printf.rs │ ├── stdlib.rs │ └── string.rs └── tools ├── README.md ├── copy_latest_crate_objects ├── Cargo.lock ├── Cargo.toml └── src │ └── main.rs ├── demangle_readelf_file ├── Cargo.lock ├── Cargo.toml └── src │ └── main.rs ├── diff_crates ├── Cargo.lock ├── Cargo.toml └── src │ └── main.rs ├── elf_cls ├── Cargo.lock ├── Cargo.toml └── src │ └── main.rs ├── get_tty ├── Cargo.lock ├── Cargo.toml └── src │ └── main.rs ├── grub_cfg_generation ├── Cargo.lock ├── Cargo.toml └── src │ └── main.rs ├── limine_compress_modules ├── Cargo.lock ├── Cargo.toml └── src │ └── main.rs ├── receive_udp_messages ├── Cargo.toml ├── README.txt ├── setup.sh └── src │ └── main.rs ├── sample_parser └── sample_parser.py ├── serialize_nano_core ├── Cargo.lock ├── Cargo.toml └── src │ ├── main.rs │ └── parse.rs ├── theseus_cargo ├── .gitignore ├── Cargo.lock ├── Cargo.toml └── src │ └── main.rs └── uefi_builder ├── README.md ├── aarch64 ├── Cargo.lock ├── Cargo.toml └── src │ └── main.rs ├── common ├── Cargo.lock ├── Cargo.toml └── src │ ├── fs.rs │ └── lib.rs └── x86_64 ├── Cargo.lock ├── Cargo.toml └── src └── main.rs /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: [kevinaboos] 4 | custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] 5 | -------------------------------------------------------------------------------- /.github/workflows/check-clippy.yaml: -------------------------------------------------------------------------------- 1 | name: Clippy Checks 2 | on: 3 | pull_request: 4 | types: [synchronize, opened, reopened] 5 | jobs: 6 | run-clippy: 7 | runs-on: ubuntu-latest 8 | steps: 9 | - uses: actions/checkout@v3 10 | - name: "Initialize git submodules" 11 | run: | 12 | git submodule update --init --recursive 13 | - name: "Install nasm" 14 | run: | 15 | sudo apt update 16 | sudo apt install nasm 17 | - name: "Run Clippy" 18 | working-directory: . 19 | run: | 20 | make clippy ARCH=x86_64 21 | make clippy ARCH=aarch64 22 | -------------------------------------------------------------------------------- /.github/workflows/test.yaml: -------------------------------------------------------------------------------- 1 | name: QEMU Test 2 | on: 3 | pull_request: 4 | types: [synchronize, opened, reopened] 5 | paths-ignore: 6 | - 'book/**' 7 | - 'c_test/**' 8 | - 'docker/**' 9 | - 'github_pages/**' 10 | - 'old_crates/**' 11 | - 'scripts/**' 12 | - '.gitignore' 13 | - 'LICENSE-MIT' 14 | - 'README.md' 15 | - 'bochsrc.txt' 16 | - 'rustfmt.toml' 17 | - 'slirp.conf' 18 | jobs: 19 | run-tests: 20 | runs-on: ubuntu-latest 21 | steps: 22 | - uses: actions/checkout@v3 23 | - name: "Initialize git submodules" 24 | run: | 25 | git submodule update --init --recursive 26 | - name: "Install dependencies" 27 | run: | 28 | sudo apt update 29 | sudo apt install make gcc nasm pkg-config grub-pc-bin mtools xorriso qemu qemu-kvm wget 30 | - name: "Run tests" 31 | working-directory: . 32 | run: make test 33 | timeout-minutes: 10 34 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled files 2 | *.o 3 | *.so 4 | *.rlib 5 | *.dll 6 | *.fd 7 | 8 | # Executables 9 | *.exe 10 | 11 | # Generated by Cargo 12 | target/ 13 | 14 | # Build directory 15 | build/ 16 | 17 | # Generated documentation, used for GitHub Pages 18 | github_pages/book/ 19 | github_pages/doc/ 20 | 21 | # patched GDB directory 22 | /rust-os-gdb/ 23 | 24 | # Theseus's local build server 25 | .theseus_build_server/ 26 | 27 | # IDE files 28 | *.idea/ 29 | *.vscode/ 30 | *.code-workspace 31 | *.swp 32 | 33 | # log files 34 | *.pcap 35 | *.out 36 | 37 | # limine bootloader files 38 | /limine-prebuilt/ 39 | 40 | # library lock files 41 | /libs/**/Cargo.lock 42 | 43 | # macOS directory stores 44 | /**/.DS_Store 45 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "libs/dfqueue"] 2 | path = libs/dfqueue 3 | url = https://github.com/theseus-os/DFQueue 4 | shallow = true 5 | [submodule "ports/wasmtime"] 6 | path = ports/wasmtime 7 | url = https://github.com/theseus-os/wasmtime.git 8 | shallow = true 9 | [submodule "libs/indexmap"] 10 | path = libs/indexmap 11 | url = https://github.com/theseus-os/indexmap 12 | shallow = true 13 | [submodule "ports/region"] 14 | path = ports/region 15 | url = https://github.com/theseus-os/region-rs 16 | shallow = true 17 | [submodule "ports/backtrace"] 18 | path = ports/backtrace 19 | url = https://github.com/theseus-os/backtrace-rs.git 20 | shallow = true 21 | [submodule "libs/core2"] 22 | path = libs/core2 23 | url = https://github.com/theseus-os/core2.git 24 | shallow = true 25 | -------------------------------------------------------------------------------- /applications/.old_static_binary_hello/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "hello" 3 | version = "0.1.0" 4 | authors = ["Kevin Boos "] 5 | 6 | [dependencies] 7 | 8 | 9 | [dependencies.log] 10 | version = "0.4.8" 11 | 12 | 13 | [dependencies.print] 14 | path = "../../kernel/print" 15 | 16 | 17 | [profile.dev] 18 | panic = "abort" 19 | 20 | [profile.release] 21 | panic = "abort" 22 | -------------------------------------------------------------------------------- /applications/.old_static_binary_hello/Makefile: -------------------------------------------------------------------------------- 1 | 2 | PWD := $(shell pwd) 3 | TARGET := x86_64-unknown-theseus 4 | RUSTFLAGS := "-C prefer-dynamic -Z pre-link-args=-nostartfiles" 5 | 6 | 7 | BUILD_MODE := release 8 | ifeq ($(BUILD_MODE), release) 9 | CARGO_OPTIONS := --release 10 | endif ## otherwise, nothing, which means "debug" by default 11 | 12 | 13 | ## this is the output path of the cargo command, not our choice. 14 | ## The name of the lib (lib_____.a) is defined by the target above. 15 | cargo-obj := target/$(TARGET)/$(BUILD_MODE)/hello 16 | 17 | 18 | 19 | .PHONY: all clean build 20 | 21 | all: build 22 | 23 | 24 | clean: 25 | cargo clean 26 | 27 | 28 | build: 29 | RUST_TARGET_PATH="$(PWD)/../../cfg" RUSTFLAGS=$(RUSTFLAGS) cargo build $(CARGO_OPTIONS) --target $(TARGET) 30 | -------------------------------------------------------------------------------- /applications/cat/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "cat" 3 | version = "0.1.0" 4 | authors = ["Kevin Boos "] 5 | 6 | [dependencies] 7 | getopts = "0.2.21" 8 | core2 = { version = "0.4.0", default-features = false, features = ["alloc", "nightly"] } 9 | 10 | 11 | [dependencies.log] 12 | version = "0.4.8" 13 | 14 | 15 | [dependencies.app_io] 16 | path = "../../kernel/app_io" 17 | 18 | [dependencies.task] 19 | path = "../../kernel/task" 20 | 21 | [dependencies.path] 22 | path = "../../kernel/path" 23 | 24 | [dependencies.fs_node] 25 | path = "../../kernel/fs_node" 26 | 27 | # [dependencies.application_main_fn] 28 | # path = "../../compiler_plugins" 29 | -------------------------------------------------------------------------------- /applications/cd/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "cd" 3 | version = "0.1.0" 4 | authors = ["Christine Wang "] 5 | 6 | [dependencies] 7 | getopts = "0.2.21" 8 | log = "0.4.8" 9 | 10 | [dependencies.app_io] 11 | path = "../../kernel/app_io" 12 | 13 | [dependencies.task] 14 | path = "../../kernel/task" 15 | 16 | [dependencies.path] 17 | path = "../../kernel/path" 18 | 19 | [dependencies.fs_node] 20 | path = "../../kernel/fs_node" 21 | 22 | [dependencies.root] 23 | path = "../../kernel/root" 24 | 25 | [dependencies.environment] 26 | path = "../../kernel/environment" 27 | 28 | # [dependencies.application_main_fn] 29 | # path = "../../compiler_plugins" -------------------------------------------------------------------------------- /applications/channel_eval/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "channel_eval" 3 | version = "0.1.0" 4 | description = "Used for evaluating live evolution between sync/async channels in Theseus" 5 | authors = ["Kevin Boos "] 6 | 7 | [dependencies] 8 | getopts = "0.2.21" 9 | 10 | [dependencies.log] 11 | version = "0.4.8" 12 | 13 | [dependencies.app_io] 14 | path = "../../kernel/app_io" 15 | 16 | [dependencies.unified_channel] 17 | path = "../../kernel/unified_channel" 18 | 19 | [dependencies.task] 20 | path = "../../kernel/task" 21 | 22 | [dependencies.spawn] 23 | path = "../../kernel/spawn" 24 | 25 | [dependencies.cpu] 26 | path = "../../kernel/cpu" 27 | -------------------------------------------------------------------------------- /applications/date/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "date" 3 | version = "0.1.0" 4 | authors = ["Kevin Boos "] 5 | 6 | [dependencies] 7 | 8 | 9 | [dependencies.app_io] 10 | path = "../../kernel/app_io" 11 | 12 | [dependencies.rtc] 13 | path = "../../kernel/rtc" 14 | 15 | # [dependencies.application_main_fn] 16 | # path = "../../compiler_plugins" 17 | -------------------------------------------------------------------------------- /applications/date/src/lib.rs: -------------------------------------------------------------------------------- 1 | #![no_std] 2 | // #![feature(plugin)] 3 | // #![plugin(application_main_fn)] 4 | 5 | 6 | extern crate alloc; 7 | #[macro_use] extern crate app_io; 8 | extern crate rtc; 9 | 10 | use alloc::vec::Vec; 11 | use alloc::string::String; 12 | 13 | 14 | pub fn main(_args: Vec) -> isize { 15 | let now = rtc::read_rtc(); 16 | println!("{}", now); 17 | 18 | 0 19 | } 20 | -------------------------------------------------------------------------------- /applications/deps/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "deps" 3 | version = "0.1.0" 4 | authors = ["Kevin Boos "] 5 | description = "Allows a developer to explore dependencies in Theseus's crate management" 6 | 7 | [dependencies] 8 | getopts = "0.2.21" 9 | spin = "0.9.4" 10 | 11 | [dependencies.log] 12 | version = "0.4.8" 13 | 14 | [dependencies.itertools] 15 | version = "0.7.9" 16 | default-features = false 17 | 18 | [dependencies.app_io] 19 | path = "../../kernel/app_io" 20 | 21 | [dependencies.crate_name_utils] 22 | path = "../../kernel/crate_name_utils" 23 | 24 | [dependencies.mod_mgmt] 25 | path = "../../kernel/mod_mgmt" 26 | 27 | [dependencies.memory] 28 | path = "../../kernel/memory" 29 | 30 | [dependencies.task] 31 | path = "../../kernel/task" 32 | -------------------------------------------------------------------------------- /applications/example/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "example" 3 | version = "0.1.0" 4 | description = "An example application that shows how to write a basic application for Theseus." 5 | authors = ["Kevin Boos "] 6 | 7 | [dependencies] 8 | getopts = "0.2.21" 9 | 10 | [dependencies.app_io] 11 | path = "../../kernel/app_io" 12 | -------------------------------------------------------------------------------- /applications/heap_eval/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "heap_eval" 3 | version = "0.1.0" 4 | description = "Benchmarks to evaluate Theseus's heap design" 5 | authors = ["Ramla Ijaz "] 6 | 7 | [dependencies] 8 | qp-trie = "0.8.1" 9 | getopts = "0.2.21" 10 | 11 | [dependencies.app_io] 12 | path = "../../kernel/app_io" 13 | 14 | [dependencies.log] 15 | version = "0.4.8" 16 | 17 | [dependencies.hpet] 18 | path = "../../kernel/acpi/hpet" 19 | 20 | [dependencies.apic] 21 | path = "../../kernel/apic" 22 | 23 | [dependencies.cpu] 24 | path = "../../kernel/cpu" 25 | 26 | [dependencies.hashbrown] 27 | version = "0.11.2" 28 | features = ["nightly"] 29 | 30 | [dependencies.libtest] 31 | path = "../../kernel/libtest" 32 | 33 | [dependencies.spawn] 34 | path = "../../kernel/spawn" 35 | 36 | [dependencies.heap] 37 | path = "../../kernel/heap" 38 | 39 | -------------------------------------------------------------------------------- /applications/hello/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "hello" 3 | version = "0.1.0" 4 | authors = ["Kevin Boos "] 5 | 6 | [dependencies] 7 | 8 | 9 | [dependencies.log] 10 | version = "0.4.8" 11 | 12 | 13 | # [dependencies.app_io] 14 | # path = "../../kernel/app_io" 15 | 16 | # [dependencies.application_main_fn] 17 | # path = "../../compiler_plugins" 18 | -------------------------------------------------------------------------------- /applications/hello/src/lib.rs: -------------------------------------------------------------------------------- 1 | #![no_std] 2 | // #![feature(plugin)] 3 | // #![plugin(application_main_fn)] 4 | 5 | 6 | extern crate alloc; 7 | // #[macro_use] extern crate app_io; 8 | 9 | use alloc::{string::String, vec::Vec}; 10 | 11 | pub fn main(_args: Vec) -> isize { 12 | log::info!("Hello, world! Args: {:?}", _args); 13 | 0 14 | } 15 | -------------------------------------------------------------------------------- /applications/hull/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "hull" 3 | version = "0.1.0" 4 | authors = ["Klim Tsoutsman "] 5 | description = "A command line shell" 6 | edition = "2021" 7 | 8 | [dependencies] 9 | app_io = { path = "../../kernel/app_io" } 10 | embedded-hal = "0.2.7" 11 | hashbrown = "0.11" 12 | mod_mgmt = { path = "../../kernel/mod_mgmt" } 13 | nb = "1.0" 14 | path = { path = "../../kernel/path" } 15 | root = { path = "../../kernel/root" } 16 | scheduler = { path = "../../kernel/scheduler" } 17 | spawn = { path = "../../kernel/spawn" } 18 | stdio = { path = "../../libs/stdio" } 19 | sync_block = { path = "../../kernel/sync_block" } 20 | task = { path = "../../kernel/task" } 21 | tty = { path = "../../kernel/tty" } 22 | log = "0.4.8" 23 | 24 | [dependencies.core2] 25 | version = "0.4.0" 26 | default-features = false 27 | features = ["alloc", "nightly"] 28 | 29 | [dependencies.noline] 30 | version = "0.2.0" 31 | features = ["alloc", "embedded"] 32 | -------------------------------------------------------------------------------- /applications/kill/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "kill" 3 | version = "0.1.0" 4 | authors = ["Christine Wang "] 5 | 6 | [dependencies] 7 | getopts = "0.2.21" 8 | 9 | [dependencies.debugit] 10 | path = "../../libs/debugit" 11 | 12 | [dependencies.app_io] 13 | path = "../../kernel/app_io" 14 | 15 | [dependencies.task] 16 | path = "../../kernel/task" 17 | 18 | # [dependencies.application_main_fn] 19 | # path = "../../compiler_plugins" 20 | -------------------------------------------------------------------------------- /applications/less/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "less" 3 | version = "0.1.0" 4 | authors = ["Zhiyao Ma "] 5 | 6 | [dependencies] 7 | getopts = "0.2.21" 8 | spin = "0.9.4" 9 | core2 = { version = "0.4.0", default-features = false, features = ["alloc", "nightly"] } 10 | 11 | [dependencies.task] 12 | path = "../../kernel/task" 13 | 14 | [dependencies.path] 15 | path = "../../kernel/path" 16 | 17 | [dependencies.fs_node] 18 | path = "../../kernel/fs_node" 19 | 20 | [dependencies.keycodes_ascii] 21 | path = "../../libs/keycodes_ascii" 22 | 23 | [dependencies.libterm] 24 | path = "../../kernel/libterm" 25 | 26 | [dependencies.app_io] 27 | path = "../../kernel/app_io" 28 | 29 | [dependencies.stdio] 30 | path = "../../libs/stdio" 31 | 32 | [dependencies.log] 33 | version = "0.4.8" 34 | 35 | 36 | [lib] 37 | crate-type = ["rlib"] 38 | -------------------------------------------------------------------------------- /applications/loadc/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "loadc" 3 | version = "0.1.0" 4 | description = "A convenience application for loading C language ELF executables." 5 | authors = ["Kevin Boos "] 6 | 7 | [dependencies] 8 | getopts = "0.2.21" 9 | log = "0.4.8" 10 | xmas-elf = { version = "0.6.2", git = "https://github.com/theseus-os/xmas-elf.git" } 11 | rustc-demangle = "0.1.19" 12 | libc = { version = "0.2.107", default-features = false } 13 | 14 | [dependencies.app_io] 15 | path = "../../kernel/app_io" 16 | 17 | [dependencies.path] 18 | path = "../../kernel/path" 19 | 20 | [dependencies.fs_node] 21 | path = "../../kernel/fs_node" 22 | 23 | [dependencies.memory] 24 | path = "../../kernel/memory" 25 | 26 | [dependencies.mod_mgmt] 27 | path = "../../kernel/mod_mgmt" 28 | 29 | [dependencies.task] 30 | path = "../../kernel/task" 31 | -------------------------------------------------------------------------------- /applications/ls/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "ls" 3 | version = "0.1.0" 4 | authors = ["Christine Wang "] 5 | 6 | [dependencies] 7 | getopts = "0.2.21" 8 | 9 | [dependencies.log] 10 | version = "0.4.8" 11 | 12 | 13 | [dependencies.app_io] 14 | path = "../../kernel/app_io" 15 | 16 | [dependencies.task] 17 | path = "../../kernel/task" 18 | 19 | [dependencies.fs_node] 20 | path = "../../kernel/fs_node" 21 | 22 | [dependencies.path] 23 | path = "../../kernel/path" 24 | 25 | # [dependencies.application_main_fn] 26 | # path = "../../compiler_plugins" -------------------------------------------------------------------------------- /applications/lspci/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "lspci" 3 | version = "0.1.0" 4 | description = "An application which lists currently connected PCI devices." 5 | authors = ["Nathan Royer "] 6 | edition = "2021" 7 | 8 | [dependencies] 9 | getopts = "0.2.21" 10 | pci = { path = "../../kernel/pci" } 11 | memory = { path = "../../kernel/memory" } 12 | app_io = { path = "../../kernel/app_io" } 13 | -------------------------------------------------------------------------------- /applications/mkdir/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "mkdir" 3 | version = "0.1.0" 4 | authors = ["Christine Wang "] 5 | 6 | [dependencies] 7 | getopts = "0.2.21" 8 | 9 | [dependencies.app_io] 10 | path = "../../kernel/app_io" 11 | 12 | [dependencies.task] 13 | path = "../../kernel/task" 14 | 15 | [dependencies.fs_node] 16 | path = "../../kernel/fs_node" 17 | 18 | [dependencies.vfs_node] 19 | path = "../../kernel/vfs_node" 20 | 21 | 22 | # [dependencies.application_main_fn] 23 | # path = "../../compiler_plugins" -------------------------------------------------------------------------------- /applications/ns/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "ns" 3 | version = "0.1.0" 4 | authors = ["Kevin Boos "] 5 | description = "An app for interacting with crate namespaces" 6 | 7 | [dependencies] 8 | getopts = "0.2.21" 9 | 10 | [dependencies.app_io] 11 | path = "../../kernel/app_io" 12 | 13 | [dependencies.mod_mgmt] 14 | path = "../../kernel/mod_mgmt" 15 | 16 | [dependencies.memory] 17 | path = "../../kernel/memory" 18 | 19 | [dependencies.task] 20 | path = "../../kernel/task" 21 | 22 | [dependencies.fs_node] 23 | path = "../../kernel/fs_node" 24 | 25 | [dependencies.path] 26 | path = "../../kernel/path" 27 | -------------------------------------------------------------------------------- /applications/ping/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "ping" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | app_io = { path = "../../kernel/app_io" } 8 | getopts = "0.2.21" 9 | net = { path = "../../kernel/net" } 10 | time = { path = "../../kernel/time" } 11 | -------------------------------------------------------------------------------- /applications/pmu_sample_start/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "pmu_sample_start" 3 | version = "0.1.0" 4 | description = "A basic application that retrieves samples." 5 | authors = ["Aryan Sefidi "] 6 | 7 | [dependencies] 8 | getopts = "0.2.21" 9 | 10 | [dependencies.pmu_x86] 11 | path = "../../kernel/pmu_x86" 12 | 13 | [dependencies.app_io] 14 | path = "../../kernel/app_io" 15 | 16 | [dependencies.spawn] 17 | path = "../../kernel/spawn" 18 | -------------------------------------------------------------------------------- /applications/pmu_sample_stop/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "pmu_sample_stop" 3 | version = "0.1.0" 4 | description = "A basic application that starts sampling and retrieves samples." 5 | authors = ["Aryan Sefidi "] 6 | 7 | [dependencies] 8 | getopts = "0.2.21" 9 | 10 | [dependencies.pmu_x86] 11 | path = "../../kernel/pmu_x86" 12 | 13 | [dependencies.app_io] 14 | path = "../../kernel/app_io" 15 | -------------------------------------------------------------------------------- /applications/pmu_sample_stop/src/lib.rs: -------------------------------------------------------------------------------- 1 | //! This application is an example of how to collect samples at from the PMU. 2 | //! The application 'pmu_sample_start' should have been called before running this application. 3 | 4 | #![no_std] 5 | 6 | extern crate alloc; 7 | #[macro_use] extern crate app_io; 8 | extern crate getopts; 9 | extern crate pmu_x86; 10 | 11 | use alloc::vec::Vec; 12 | use alloc::string::String; 13 | 14 | pub fn main(_args: Vec) -> isize { 15 | let sampler = pmu_x86::retrieve_samples(); 16 | if let Ok(my_sampler) = sampler { 17 | pmu_x86::print_samples(&my_sampler); 18 | if let Err(e) = pmu_x86::find_function_names_from_samples(&my_sampler) { 19 | println!("Error finding function names from samples: {:?}", e); 20 | } 21 | } 22 | else { 23 | println!("Could not retrieve samples"); 24 | return -1; 25 | } 26 | 27 | 0 28 | } 29 | 30 | -------------------------------------------------------------------------------- /applications/print_fault_log/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "print_fault_log" 3 | version = "0.1.0" 4 | authors = ["Namitha Liyanage "] 5 | 6 | [dependencies.fault_log] 7 | path = "../../kernel/fault_log" 8 | -------------------------------------------------------------------------------- /applications/print_fault_log/src/lib.rs: -------------------------------------------------------------------------------- 1 | //! A simple application to print the fault log 2 | 3 | #![no_std] 4 | 5 | extern crate alloc; 6 | extern crate fault_log; 7 | 8 | use alloc::vec::Vec; 9 | use alloc::string::String; 10 | use fault_log::print_fault_log; 11 | 12 | pub fn main(_args: Vec) -> isize { 13 | print_fault_log(); 14 | 0 15 | } 16 | -------------------------------------------------------------------------------- /applications/ps/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "ps" 3 | version = "0.1.0" 4 | authors = ["Christine Wang "] 5 | 6 | [dependencies] 7 | getopts = "0.2.21" 8 | 9 | [dependencies.app_io] 10 | path = "../../kernel/app_io" 11 | 12 | [dependencies.task] 13 | path = "../../kernel/task" 14 | 15 | [dependencies.scheduler] 16 | path = "../../kernel/scheduler" 17 | 18 | # [dependencies.application_main_fn] 19 | # path = "../../compiler_plugins" 20 | -------------------------------------------------------------------------------- /applications/pwd/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "pwd" 3 | version = "0.1.0" 4 | authors = ["Christine Wang "] 5 | 6 | [dependencies] 7 | getopts = "0.2.21" 8 | 9 | [dependencies.app_io] 10 | path = "../../kernel/app_io" 11 | 12 | [dependencies.task] 13 | path = "../../kernel/task" 14 | 15 | # [dependencies.application_main_fn] 16 | # path = "../../compiler_plugins" -------------------------------------------------------------------------------- /applications/pwd/src/lib.rs: -------------------------------------------------------------------------------- 1 | #![no_std] 2 | #[macro_use] extern crate app_io; 3 | 4 | extern crate alloc; 5 | extern crate task; 6 | extern crate getopts; 7 | 8 | use alloc::vec::Vec; 9 | use alloc::string::String; 10 | 11 | pub fn main(_args: Vec) -> isize { 12 | task::with_current_task(|t| { 13 | println!("{}", t.get_env().lock().cwd()); 14 | 0 15 | }).unwrap_or_else(|_| { 16 | println!("failed to get current task"); 17 | -1 18 | }) 19 | } -------------------------------------------------------------------------------- /applications/qemu_test/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "qemu_test" 3 | version = "0.1.0" 4 | authors = ["Klim Tsoutsman "] 5 | description = "Automated test runner" 6 | edition = "2021" 7 | 8 | [dependencies] 9 | app_io = { path = "../../kernel/app_io" } 10 | path = { path = "../../kernel/path" } 11 | qemu-exit = "3.0.2" 12 | spawn = { path = "../../kernel/spawn" } 13 | task = { path = "../../kernel/task" } 14 | -------------------------------------------------------------------------------- /applications/raw_mode/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "raw_mode" 3 | version = "0.1.0" 4 | authors = ["Zhiyao Ma "] 5 | edition = "2021" 6 | 7 | [dependencies.app_io] 8 | path = "../../kernel/app_io" 9 | 10 | [dependencies.log] 11 | version = "0.4.8" 12 | 13 | [lib] 14 | crate-type = ["rlib"] 15 | -------------------------------------------------------------------------------- /applications/raw_mode/src/lib.rs: -------------------------------------------------------------------------------- 1 | //! An application to test raw mode. 2 | 3 | #![no_std] 4 | 5 | extern crate alloc; 6 | 7 | use alloc::{string::String, vec::Vec}; 8 | 9 | pub fn main(_args: Vec) -> isize { 10 | if let Err(e) = run() { 11 | log::error!("{}", e); 12 | return 1; 13 | } 14 | 0 15 | } 16 | 17 | fn run() -> Result<(), &'static str> { 18 | let discipline = app_io::line_discipline()?; 19 | discipline.set_raw(); 20 | 21 | let stdin = app_io::stdin()?; 22 | let stdout = app_io::stdout()?; 23 | let mut buf = [0u8]; 24 | 25 | loop { 26 | let byte_num = stdin.read(&mut buf).or(Err("failed to invoke read"))?; 27 | if byte_num == 0 { 28 | break; 29 | } 30 | stdout 31 | .write_all(&buf) 32 | .or(Err("failed to invoke write_all"))?; 33 | } 34 | 35 | Ok(()) 36 | } 37 | -------------------------------------------------------------------------------- /applications/rm/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "rm" 3 | version = "0.1.0" 4 | authors = ["Andrew Pham "] 5 | edition = "2021" 6 | 7 | [dependencies] 8 | getopts = "0.2.21" 9 | 10 | [dependencies.app_io] 11 | path = "../../kernel/app_io" 12 | 13 | [dependencies.cpu] 14 | path = "../../kernel/cpu" 15 | 16 | [dependencies.task] 17 | path = "../../kernel/task" 18 | 19 | # [dependencies.application_main_fn] 20 | # path = "../../compiler_plugins" 21 | -------------------------------------------------------------------------------- /applications/rq_eval/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "rq_eval" 3 | version = "0.1.0" 4 | description = "A application that microbenchmarks runqueue performance" 5 | authors = ["Kevin Boos "] 6 | 7 | [dependencies] 8 | getopts = "0.2.21" 9 | 10 | 11 | [dependencies.log] 12 | version = "0.4.8" 13 | 14 | [dependencies.spawn] 15 | path = "../../kernel/spawn" 16 | 17 | [dependencies.hpet] 18 | path = "../../kernel/acpi/hpet" 19 | 20 | [dependencies.task] 21 | path = "../../kernel/task" 22 | 23 | [dependencies.cpu] 24 | path = "../../kernel/cpu" 25 | 26 | [dependencies.app_io] 27 | path = "../../kernel/app_io" 28 | 29 | [dependencies.libtest] 30 | path = "../../kernel/libtest" 31 | -------------------------------------------------------------------------------- /applications/scheduler_eval/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "scheduler_eval" 3 | version = "0.1.0" 4 | authors = ["Klim Tsoutsman "] 5 | description = "Scheduler benchmark" 6 | edition = "2021" 7 | 8 | [dependencies] 9 | app_io = { path = "../../kernel/app_io" } 10 | getopts = "0.2" 11 | scheduler = { path = "../../kernel/scheduler" } 12 | spawn = { path = "../../kernel/spawn" } 13 | time = { path = "../../kernel/time" } 14 | cpu = { path = "../../kernel/cpu" } 15 | -------------------------------------------------------------------------------- /applications/seconds_counter/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "seconds_counter" 3 | version = "0.1.0" 4 | authors = ["Klim Tsoutsman "] 5 | description = "A secounds counter" 6 | edition = "2021" 7 | 8 | [dependencies] 9 | app_io = { path = "../../kernel/app_io" } 10 | time = { path = "../../kernel/time" } 11 | 12 | -------------------------------------------------------------------------------- /applications/seconds_counter/src/lib.rs: -------------------------------------------------------------------------------- 1 | #![no_std] 2 | 3 | extern crate alloc; 4 | 5 | use alloc::{string::String, vec::Vec}; 6 | 7 | pub fn main(_: Vec) { 8 | let mut counter = 0; 9 | let mut previous = time::now::(); 10 | loop { 11 | let now = time::now::(); 12 | if now.duration_since(previous) >= time::Duration::from_secs(1) { 13 | counter += 1; 14 | app_io::println!("{}", counter); 15 | previous = now; 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /applications/serial_echo/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "serial_echo" 3 | version = "0.1.0" 4 | authors = ["Kevin Boos "] 5 | description = "a simple app for testing serial port I/O using higher-level I/O traits" 6 | 7 | [dependencies] 8 | core2 = { version = "0.4.0", default-features = false, features = ["alloc", "nightly"] } 9 | log = "0.4.8" 10 | 11 | [dependencies.sync_irq] 12 | path = "../../libs/sync_irq" 13 | 14 | [dependencies.app_io] 15 | path = "../../kernel/app_io" 16 | 17 | [dependencies.task] 18 | path = "../../kernel/task" 19 | 20 | [dependencies.serial_port] 21 | path = "../../kernel/serial_port" 22 | 23 | [dependencies.io] 24 | path = "../../kernel/io" 25 | -------------------------------------------------------------------------------- /applications/swap/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "swap" 3 | version = "0.1.0" 4 | authors = ["Kevin Boos "] 5 | 6 | [dependencies] 7 | getopts = "0.2.21" 8 | 9 | [dependencies.itertools] 10 | version = "0.7.9" 11 | default-features = false 12 | 13 | [dependencies.app_io] 14 | path = "../../kernel/app_io" 15 | 16 | [dependencies.mod_mgmt] 17 | path = "../../kernel/mod_mgmt" 18 | 19 | [dependencies.crate_swap] 20 | path = "../../kernel/crate_swap" 21 | 22 | [dependencies.memory] 23 | path = "../../kernel/memory" 24 | 25 | [dependencies.task] 26 | path = "../../kernel/task" 27 | 28 | [dependencies.hpet] 29 | path = "../../kernel/acpi/hpet" 30 | 31 | [dependencies.fs_node] 32 | path = "../../kernel/fs_node" 33 | 34 | [dependencies.path] 35 | path = "../../kernel/path" 36 | -------------------------------------------------------------------------------- /applications/test_aligned_page_allocation/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "test_aligned_page_allocation" 3 | version = "0.1.0" 4 | description = "Tests the `AllocationRequest::AlignedTo` variant, which is needed for huge pages" 5 | authors = ["Kevin Boos "] 6 | edition = "2021" 7 | 8 | [dependencies] 9 | log = "0.4.8" 10 | 11 | [dependencies.memory] 12 | path = "../../kernel/memory" 13 | 14 | [dependencies.app_io] 15 | path = "../../kernel/app_io" 16 | -------------------------------------------------------------------------------- /applications/test_async/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "test_async" 3 | version = "0.1.0" 4 | authors = ["Klim Tsoutsman "] 5 | description = "A test application for the asynchronous executor" 6 | edition = "2021" 7 | 8 | [dependencies] 9 | app_io = { path = "../../kernel/app_io" } 10 | dreadnought = { path = "../../kernel/dreadnought" } 11 | -------------------------------------------------------------------------------- /applications/test_backtrace/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "test_backtrace" 3 | version = "0.1.0" 4 | authors = ["Kevin Boos "] 5 | 6 | [dependencies] 7 | backtrace = { path = "../../ports/backtrace", default-features = false } 8 | 9 | [dependencies.log] 10 | version = "0.4.8" 11 | 12 | 13 | [dependencies.app_io] 14 | path = "../../kernel/app_io" 15 | 16 | [dependencies.task] 17 | path = "../../kernel/task" 18 | 19 | 20 | # [dependencies.application_main_fn] 21 | # path = "../../compiler_plugins" 22 | -------------------------------------------------------------------------------- /applications/test_block_io/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "test_block_io" 3 | version = "0.1.0" 4 | authors = ["Kevin Boos "] 5 | description = "a simple app for testing IO transfers for block devices" 6 | edition = "2021" 7 | 8 | [dependencies] 9 | core2 = { version = "0.4.0", default-features = false, features = ["alloc", "nightly"] } 10 | 11 | [dependencies.log] 12 | version = "0.4.8" 13 | 14 | [dependencies.app_io] 15 | path = "../../kernel/app_io" 16 | 17 | [dependencies.task] 18 | path = "../../kernel/task" 19 | 20 | [dependencies.io] 21 | path = "../../kernel/io" 22 | 23 | [dependencies.storage_manager] 24 | path = "../../kernel/storage_manager" 25 | 26 | [dependencies.ata] 27 | path = "../../kernel/ata" 28 | -------------------------------------------------------------------------------- /applications/test_channel/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "test_channel" 3 | version = "0.1.0" 4 | description = "Tests Theseus's channel implementations with multiple tasks" 5 | authors = ["Kevin Boos "] 6 | 7 | [dependencies] 8 | getopts = "0.2.21" 9 | spin = "0.9.4" 10 | 11 | [dependencies.app_io] 12 | path = "../../kernel/app_io" 13 | 14 | [dependencies.log] 15 | version = "0.4.8" 16 | 17 | [dependencies.scheduler] 18 | path = "../../kernel/scheduler" 19 | 20 | [dependencies.task] 21 | path = "../../kernel/task" 22 | 23 | [dependencies.cpu] 24 | path = "../../kernel/cpu" 25 | 26 | [dependencies.spawn] 27 | path = "../../kernel/spawn" 28 | 29 | [dependencies.rendezvous] 30 | path = "../../kernel/rendezvous" 31 | 32 | [dependencies.sync_channel] 33 | path = "../../kernel/sync_channel" 34 | -------------------------------------------------------------------------------- /applications/test_filerw/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "test_filerw" 3 | version = "0.1.0" 4 | authors = ["Andrew Pham "] 5 | 6 | [dependencies] 7 | 8 | 9 | [dependencies.log] 10 | version = "0.4.8" 11 | 12 | 13 | [dependencies.app_io] 14 | path = "../../kernel/app_io" 15 | 16 | [dependencies.memfs] 17 | path = "../../kernel/memfs" 18 | 19 | [dependencies.root] 20 | path = "../../kernel/root" 21 | 22 | [dependencies.memory] 23 | path = "../../kernel/memory" 24 | # [dependencies.application_main_fn] 25 | # path = "../../compiler_plugins" 26 | -------------------------------------------------------------------------------- /applications/test_identity_mapping/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "test_identity_mapping" 3 | version = "0.1.0" 4 | description = "Tests the `memory::create_identity_mapping()` function" 5 | authors = ["Kevin Boos "] 6 | edition = "2021" 7 | 8 | [dependencies] 9 | log = "0.4.8" 10 | 11 | [dependencies.memory] 12 | path = "../../kernel/memory" 13 | 14 | [dependencies.app_io] 15 | path = "../../kernel/app_io" 16 | -------------------------------------------------------------------------------- /applications/test_identity_mapping/src/lib.rs: -------------------------------------------------------------------------------- 1 | //! A set of basic tests for [`memory::create_identity_mapping()`]. 2 | 3 | #![no_std] 4 | 5 | extern crate alloc; 6 | 7 | use alloc::{ 8 | vec::Vec, 9 | string::String, 10 | }; 11 | use app_io::println; 12 | 13 | static TEST_SET: [usize; 8] = [1, 2, 4, 8, 25, 48, 256, 1024]; 14 | 15 | pub fn main(_args: Vec) -> isize { 16 | match rmain() { 17 | Ok(_) => 0, 18 | Err(e) => { 19 | println!("Error: {}", e); 20 | -1 21 | } 22 | } 23 | } 24 | 25 | fn rmain() -> Result<(), &'static str> { 26 | let flags = memory::PteFlags::new().valid(true); 27 | for num_pages in TEST_SET.into_iter() { 28 | println!("Attempting to create identity mapping of {num_pages} pages..."); 29 | let mp = memory::create_identity_mapping(num_pages, flags)?; 30 | assert_eq!(mp.size_in_pages(), num_pages); 31 | println!(" Success: {mp:?}"); 32 | } 33 | 34 | Ok(()) 35 | } 36 | -------------------------------------------------------------------------------- /applications/test_ixgbe/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "test_ixgbe" 3 | version = "0.1.0" 4 | authors = ["Ramla Ijaz "] 5 | edition = "2021" 6 | 7 | [dependencies] 8 | getopts = "0.2.21" 9 | 10 | [dependencies.log] 11 | version = "0.4.8" 12 | 13 | [dependencies.app_io] 14 | path = "../../kernel/app_io" 15 | 16 | [dependencies.ixgbe] 17 | path = "../../kernel/ixgbe" 18 | 19 | [dependencies.spawn] 20 | path = "../../kernel/spawn" 21 | 22 | [dependencies.net] 23 | path = "../../kernel/net" 24 | -------------------------------------------------------------------------------- /applications/test_libc/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["Kevin Boos "] 3 | name = "test_libc" 4 | description = "A crate for testing tlibc with the libc Rust crate ported to Theseus" 5 | version = "0.1.0" 6 | 7 | [dependencies] 8 | log = "0.4.8" 9 | libc = { version = "0.2", default-features = false } 10 | 11 | 12 | [lib] 13 | crate-type = ["rlib"] 14 | -------------------------------------------------------------------------------- /applications/test_mlx5/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "test_mlx5" 3 | version = "0.1.0" 4 | authors = ["Ramla Ijaz "] 5 | 6 | [dependencies] 7 | 8 | [dependencies.log] 9 | version = "0.4.8" 10 | 11 | [dependencies.app_io] 12 | path = "../../kernel/app_io" 13 | 14 | [dependencies.ixgbe] 15 | path = "../../kernel/ixgbe" 16 | 17 | [dependencies.mlx5] 18 | path = "../../kernel/mlx5" 19 | -------------------------------------------------------------------------------- /applications/test_panic/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "test_panic" 3 | version = "0.1.0" 4 | authors = ["Kevin Boos "] 5 | 6 | [dependencies] 7 | 8 | [dependencies.log] 9 | version = "0.4.8" 10 | 11 | 12 | [dependencies.app_io] 13 | path = "../../kernel/app_io" 14 | 15 | [dependencies.task] 16 | path = "../../kernel/task" 17 | 18 | 19 | # [dependencies.application_main_fn] 20 | # path = "../../compiler_plugins" 21 | -------------------------------------------------------------------------------- /applications/test_preemption_counter/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "test_preemption_counter" 3 | version = "0.1.0" 4 | authors = ["Klim Tsoutsman "] 5 | description = "Application for testing the preemption counter" 6 | edition = "2021" 7 | 8 | [dependencies] 9 | app_io = { path = "../../kernel/app_io" } 10 | preemption = { path = "../../kernel/preemption" } 11 | -------------------------------------------------------------------------------- /applications/test_restartable/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "test_restartable" 3 | version = "0.1.0" 4 | authors = ["Namitha Liyanage "] 5 | 6 | [dependencies] 7 | getopts = "0.2.21" 8 | spin = "0.9.4" 9 | 10 | [dependencies.log] 11 | default-features = false 12 | version = "0.4.8" 13 | 14 | [dependencies.spawn] 15 | path = "../../kernel/spawn" 16 | 17 | [dependencies.app_io] 18 | path = "../../kernel/app_io" 19 | -------------------------------------------------------------------------------- /applications/test_scheduler/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "test_scheduler" 3 | version = "0.1.0" 4 | authors = ["Klim Tsoutsman "] 5 | description = "An application to test the scheduler" 6 | edition = "2021" 7 | 8 | [dependencies] 9 | app_io = { path = "../../kernel/app_io" } 10 | cpu = { path = "../../kernel/cpu" } 11 | log = "0.4.8" 12 | random = { path = "../../kernel/random" } 13 | spawn = { path = "../../kernel/spawn" } 14 | sync_block = { path = "../../kernel/sync_block" } 15 | task = { path = "../../kernel/task" } 16 | 17 | [dependencies.rand] 18 | version = "0.8.5" 19 | default-features = false 20 | features = ["small_rng"] 21 | -------------------------------------------------------------------------------- /applications/test_std_fs/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "test_std_fs" 3 | version = "0.1.0" 4 | authors = ["Kevin Boos "] 5 | 6 | [dependencies] 7 | log = "0.4.8" 8 | core2 = { version = "0.4.0", default-features = false, features = ["alloc", "nightly"] } 9 | 10 | [dependencies.theseus_std] 11 | path = "../../ports/theseus_std" 12 | 13 | [dependencies.app_io] 14 | path = "../../kernel/app_io" 15 | -------------------------------------------------------------------------------- /applications/test_std_fs/src/lib.rs: -------------------------------------------------------------------------------- 1 | //! Tests the basic features of Theseus's port of `std::fs` modules from Rust `std`. 2 | //! 3 | #![no_std] 4 | 5 | extern crate alloc; 6 | extern crate log; 7 | extern crate theseus_std; 8 | extern crate core2; 9 | #[macro_use] extern crate app_io; 10 | 11 | use alloc::{string::String, vec::Vec}; 12 | use core2::io::{self, Write}; 13 | 14 | 15 | pub fn main(_args: Vec) -> isize { 16 | match rmain(_args) { 17 | Ok(_) => { 18 | println!("test_std_fs complete!"); 19 | 0 20 | } 21 | Err(e) => { 22 | println!("test_std_fs error: {:?}", e); 23 | -1 24 | } 25 | } 26 | } 27 | 28 | 29 | fn rmain(_args: Vec) -> io::Result<()> { 30 | let mut out = theseus_std::fs::File::create("test.txt")?; 31 | out.write(b"yo what's up\nhey there!")?; 32 | out.write_all(b"take 2: yo what's up, hey there!")?; 33 | Ok(()) 34 | } 35 | -------------------------------------------------------------------------------- /applications/test_sync_block/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "test_sync_block" 3 | version = "0.1.0" 4 | description = "Tests the blocking sleeping mutex with multiple tasks" 5 | authors = ["Kevin Boos "] 6 | edition = "2021" 7 | 8 | [dependencies.log] 9 | version = "0.4.8" 10 | 11 | [dependencies.scheduler] 12 | path = "../../kernel/scheduler" 13 | 14 | [dependencies.task] 15 | path = "../../kernel/task" 16 | 17 | [dependencies.cpu] 18 | path = "../../kernel/cpu" 19 | 20 | [dependencies.spawn] 21 | path = "../../kernel/spawn" 22 | 23 | [dependencies.sync_block] 24 | path = "../../kernel/sync_block" 25 | -------------------------------------------------------------------------------- /applications/test_task_cancel/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "test_task_cancel" 3 | version = "0.1.0" 4 | authors = ["Klim Tsoutsman "] 5 | description = "Task cancellation test" 6 | edition = "2021" 7 | 8 | [dependencies] 9 | log = "0.4" 10 | spawn = { path = "../../kernel/spawn" } 11 | spin = "0.9" 12 | task = { path = "../../kernel/task" } 13 | -------------------------------------------------------------------------------- /applications/test_tls/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "test_tls" 3 | version = "0.1.0" 4 | authors = ["Kevin Boos "] 5 | 6 | [dependencies] 7 | 8 | 9 | [dependencies.log] 10 | version = "0.4.8" 11 | 12 | 13 | [dependencies.app_io] 14 | path = "../../kernel/app_io" 15 | 16 | [dependencies.test_thread_local] 17 | path = "../../kernel/test_thread_local" 18 | 19 | [dependencies.thread_local_macro] 20 | path = "../../kernel/thread_local_macro" 21 | -------------------------------------------------------------------------------- /applications/test_wait_queue/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "test_wait_queue" 3 | version = "0.1.0" 4 | description = "Tests the wait queue functionality of Theseus with multiple tasks" 5 | authors = ["Kevin Boos "] 6 | 7 | [dependencies] 8 | spin = "0.9.4" 9 | 10 | [dependencies.log] 11 | version = "0.4.8" 12 | 13 | [dependencies.task] 14 | path = "../../kernel/task" 15 | 16 | [dependencies.cpu] 17 | path = "../../kernel/cpu" 18 | 19 | [dependencies.scheduler] 20 | path = "../../kernel/scheduler" 21 | 22 | [dependencies.spawn] 23 | path = "../../kernel/spawn" 24 | 25 | [dependencies.wait_condition] 26 | path = "../../kernel/wait_condition" 27 | 28 | [dependencies.app_io] 29 | path = "../../kernel/app_io" 30 | -------------------------------------------------------------------------------- /applications/test_wasmtime/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "test_wasmtime" 3 | version = "0.1.0" 4 | authors = ["Kevin Boos "] 5 | description = "Basic test cases for running `wasmtime` on Theseus" 6 | edition = "2018" 7 | 8 | [dependencies] 9 | log = "0.4.8" 10 | anyhow = { version = "1.0", default-features = false } 11 | getopts = "0.2.21" 12 | 13 | [dependencies.app_io] 14 | path = "../../kernel/app_io" 15 | 16 | [dependencies.path] 17 | path = "../../kernel/path" 18 | 19 | [dependencies.task] 20 | path = "../../kernel/task" 21 | 22 | [dependencies.wasmtime] 23 | path = "../../ports/wasmtime/crates/wasmtime" 24 | default-features = false 25 | -------------------------------------------------------------------------------- /applications/unwind_test/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "unwind_test" 3 | version = "0.1.0" 4 | authors = ["Kevin Boos "] 5 | description = "a simple app for testing whether unwinding works" 6 | 7 | [dependencies] 8 | 9 | 10 | [dependencies.log] 11 | version = "0.4.8" 12 | 13 | 14 | [dependencies.app_io] 15 | path = "../../kernel/app_io" 16 | 17 | [dependencies.task] 18 | path = "../../kernel/task" 19 | 20 | [dependencies.catch_unwind] 21 | path = "../../kernel/catch_unwind" 22 | -------------------------------------------------------------------------------- /applications/wasm/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "wasm" 3 | version = "0.1.0" 4 | authors = ["Vikram Mullick "] 5 | edition = "2018" 6 | description = "Application for running WASI-compliant WebAssembly binaries from Theseus command line" 7 | 8 | [dependencies] 9 | getopts = "0.2.21" 10 | 11 | [dependencies.app_io] 12 | path = "../../kernel/app_io" 13 | 14 | [dependencies.task] 15 | path = "../../kernel/task" 16 | 17 | [dependencies.path] 18 | path = "../../kernel/path" 19 | 20 | [dependencies.fs_node] 21 | path = "../../kernel/fs_node" 22 | 23 | [dependencies.wasi_interpreter] 24 | path = "../../kernel/wasi_interpreter" 25 | -------------------------------------------------------------------------------- /book/.gitignore: -------------------------------------------------------------------------------- 1 | ## the output of mdbook 2 | book/ 3 | -------------------------------------------------------------------------------- /book/book.toml: -------------------------------------------------------------------------------- 1 | [book] 2 | title = "The Theseus OS Book" 3 | authors = ["Kevin Boos", "Lin Zhong"] 4 | description = "Describes the design principles and implementation details of Theseus, a companion to its source-level docs." 5 | multilingual = false 6 | src = "src" 7 | 8 | [output.html] 9 | 10 | [output.linkcheck] 11 | optional = true 12 | ## See other linkcheck options here: -------------------------------------------------------------------------------- /book/src/design/intralingual.md: -------------------------------------------------------------------------------- 1 | # Intralingual Design in Theseus 2 | 3 | Intralingual, or *within* the language, refers to 4 | 5 | TODO: finish this -------------------------------------------------------------------------------- /book/src/misc/crate_namespaces.md: -------------------------------------------------------------------------------- 1 | # Cells and Cell Namespaces 2 | 3 | All crate object files are loaded into a **namespace**, 4 | 5 | 6 | 7 | In our academic papers, `LoadedCrates` are called `LoadedCells` -------------------------------------------------------------------------------- /book/src/misc/quick_start.md: -------------------------------------------------------------------------------- 1 | # Theseus README + Quick Start 2 | 3 | [Click here to see the main Theseus README for quick start instructions.](https://github.com/theseus-os/Theseus/blob/theseus_main/README.md) 4 | 5 | -------------------------------------------------------------------------------- /book/src/running/usb.md: -------------------------------------------------------------------------------- 1 | # Booting Theseus from a USB drive 2 | 3 | To boot over USB, simply run 4 | ```sh 5 | make boot usb=sdc 6 | ``` 7 | in which `sdc` is the device node for the USB disk itself *(**not a partition** like sdc2)*. 8 | The OS image (.iso file) will be written to that USB drive. 9 | 10 | On WSL or other host environments where `/dev` device nodes don't exist, you can simply run `make iso` and burn the `.iso` file in the `build/` directory to a USB drive. 11 | For example, on Windows we recommend using [Rufus](https://rufus.ie/) to burn ISOs. 12 | 13 | Then, once the bootable USB is ready, plug it into your PC, restart or power on the machine, and choose that USB device from the BIOS or legacy boot device screen. -------------------------------------------------------------------------------- /book/src/subsystems/display/display.md: -------------------------------------------------------------------------------- 1 | # Display Subsystem 2 | 3 | *Warning:* the display subsystem in Theseus is in need of complete redesign. It is inefficient and poorly implemented, as it was simply a means to the end of being able to interact with the system, and unfortunately has not been a focus of any significant effort. -------------------------------------------------------------------------------- /book/src/subsystems/subsystems.md: -------------------------------------------------------------------------------- 1 | # Overview of Key Subsystems 2 | 3 | Like every OS, Theseus's functionality can be categorized into multiple *subsystems*, which each implement a different core OS feature. 4 | This section covers the design and implementation of key subsystems in Theseus, such as memory management, multitasking support, graphical displays, etc. -------------------------------------------------------------------------------- /c_test/dummy.c: -------------------------------------------------------------------------------- 1 | // We don't yet have C library header files, so we can't really call or do anything yet. 2 | 3 | // create some named .rodata 4 | const char *const HELLO = "hello world"; 5 | 6 | // create some named .data and unnamed .rodata 7 | char *s = "me"; 8 | 9 | void test() { 10 | char *t = s; 11 | __asm__("mov %0, %%r11" : : "r"(s) : "%r11" ); 12 | // while (*t != 0) { 13 | // t--; 14 | // } 15 | __asm__("mov $0x4444555566667777, %r10"); 16 | } 17 | 18 | int main() { 19 | // __asm__("cli"); 20 | // __asm__("mov $0xBEEFBEEFBEEFBEEF, %r9"); 21 | // while (1) { 22 | // test(); 23 | // } 24 | return 0x1234BEEF; 25 | } 26 | -------------------------------------------------------------------------------- /c_test/print_test.c: -------------------------------------------------------------------------------- 1 | // Basic test printf functions 2 | 3 | #include 4 | #include 5 | 6 | // create some named .rodata 7 | const char *const HELLO = "hello world"; 8 | 9 | // create some named .data and unnamed .rodata 10 | char *s = "me"; 11 | 12 | 13 | int main(int argc, char *argv[]) { 14 | printf("Printing 17: %d\n", 17); 15 | for (int i = 0; i < argc; i++) { 16 | printf("arg %u: %s\n", i, argv[i]); 17 | } 18 | 19 | printf("HELLO STRING: %s (len %ld)\n", HELLO, strlen(HELLO)); 20 | 21 | return 0x1234; 22 | } 23 | -------------------------------------------------------------------------------- /cfg/aarch64-unknown-theseus.json: -------------------------------------------------------------------------------- 1 | { 2 | "abi": "softfloat", 3 | "arch": "aarch64", 4 | "code-model": "large", 5 | "data-layout": "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128", 6 | "disable-redzone": true, 7 | "executables": true, 8 | "features": "+strict-align,-neon,-fp-armv8", 9 | "has-thread-local": true, 10 | "linker": "rust-lld", 11 | "linker-flavor": "ld.lld", 12 | "llvm-target": "aarch64-unknown-none-elf", 13 | "max-atomic-width": 128, 14 | "merge-functions": "disabled", 15 | "os": "theseus", 16 | "panic-strategy": "unwind", 17 | "relocation-model": "static", 18 | "relro-level": "full", 19 | "supported-sanitizers": [ 20 | "kcfi" 21 | ], 22 | "target-pointer-width": "64", 23 | "tls-model": "local-exec" 24 | } 25 | -------------------------------------------------------------------------------- /cfg/limine.cfg: -------------------------------------------------------------------------------- 1 | DEFAULT_ENTRY=0 2 | TIMEOUT=0 3 | VERBOSE=yes 4 | 5 | :Theseus OS 6 | PROTOCOL=multiboot2 7 | KERNEL_PATH=boot:///boot/kernel.bin 8 | MODULE_PATH=boot:///modules.cpio.lz4 9 | MODULE_STRING=modules.cpio.lz4 10 | -------------------------------------------------------------------------------- /cfg/x86_64-unknown-theseus-avx.json: -------------------------------------------------------------------------------- 1 | { 2 | "arch": "x86_64", 3 | "code-model": "large", 4 | "cpu": "x86-64", 5 | "data-layout": "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128", 6 | "disable-redzone": true, 7 | "features": "+avx", 8 | "has-thread-local": true, 9 | "linker-flavor": "ld.lld", 10 | "linker": "rust-lld", 11 | "llvm-target": "x86_64-unknown-none-elf", 12 | "max-atomic-width": 64, 13 | "merge-functions": "disabled", 14 | "os": "theseus", 15 | "panic-strategy": "unwind", 16 | "relocation-model": "static", 17 | "relro-level": "full", 18 | "target-pointer-width": "64", 19 | "tls-model": "local-exec" 20 | } 21 | -------------------------------------------------------------------------------- /cfg/x86_64-unknown-theseus-sse.json: -------------------------------------------------------------------------------- 1 | { 2 | "arch": "x86_64", 3 | "code-model": "large", 4 | "cpu": "x86-64", 5 | "data-layout": "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128", 6 | "disable-redzone": true, 7 | "features": "+sse2", 8 | "has-thread-local": true, 9 | "linker-flavor": "ld.lld", 10 | "linker": "rust-lld", 11 | "llvm-target": "x86_64-unknown-none-elf", 12 | "max-atomic-width": 64, 13 | "merge-functions": "disabled", 14 | "os": "theseus", 15 | "panic-strategy": "unwind", 16 | "relocation-model": "static", 17 | "relro-level": "full", 18 | "target-pointer-width": "64", 19 | "tls-model": "local-exec" 20 | } 21 | -------------------------------------------------------------------------------- /cfg/x86_64-unknown-theseus.json: -------------------------------------------------------------------------------- 1 | { 2 | "arch": "x86_64", 3 | "code-model": "large", 4 | "cpu": "x86-64", 5 | "data-layout": "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128", 6 | "disable-redzone": true, 7 | "features": "-mmx,-sse,-sse2,-sse3,-ssse3,-sse4.1,-sse4.2,-3dnow,-3dnowa,-avx,-avx2,+soft-float", 8 | "has-thread-local": true, 9 | "linker-flavor": "ld.lld", 10 | "linker": "rust-lld", 11 | "llvm-target": "x86_64-unknown-none-elf", 12 | "max-atomic-width": 64, 13 | "merge-functions": "disabled", 14 | "os": "theseus", 15 | "panic-strategy": "unwind", 16 | "relocation-model": "static", 17 | "relro-level": "full", 18 | "target-pointer-width": "64", 19 | "tls-model": "local-exec" 20 | } 21 | -------------------------------------------------------------------------------- /compiler_plugins/Cargo.lock: -------------------------------------------------------------------------------- 1 | [[package]] 2 | name = "application_main_fn" 3 | version = "0.1.0" 4 | 5 | -------------------------------------------------------------------------------- /compiler_plugins/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "application_main_fn" 3 | version = "0.1.0" 4 | authors = ["Kevin Boos "] 5 | 6 | [dependencies] 7 | 8 | [lib] 9 | crate-type = [ "dylib" ] 10 | path = "application_main_fn.rs" -------------------------------------------------------------------------------- /docker/install_docker_ubuntu.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ### This is a convenience script for installing docker on Ubuntu. 4 | ### Commands were copied from here: 5 | 6 | sudo apt-get update 7 | 8 | sudo apt-get install \ 9 | apt-transport-https \ 10 | ca-certificates \ 11 | curl \ 12 | gnupg-agent \ 13 | software-properties-common 14 | 15 | curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - 16 | 17 | sudo add-apt-repository \ 18 | "deb [arch=amd64] https://download.docker.com/linux/ubuntu \ 19 | $(lsb_release -cs) \ 20 | stable" 21 | 22 | sudo apt-get update 23 | sudo apt-get install -y docker-ce docker-ce-cli containerd.io 24 | 25 | sudo docker run hello-world 26 | -------------------------------------------------------------------------------- /extra_files/test_files/text/a_new_hope.txt: -------------------------------------------------------------------------------- 1 | It is a period of civil war. 2 | Rebel spaceships, striking 3 | from a hidden base, have won 4 | their first victory against 5 | the evil Galactic Empire. 6 | 7 | During the battle, Rebel 8 | spies managed to steal secret 9 | plans to the Empire's 10 | ultimate weapon, the DEATH 11 | STAR, an armored space 12 | station with enough power to 13 | destroy an entire planet. 14 | 15 | Pursued by the Empire's 16 | sinister agents, Princess 17 | Leia races home aboard her 18 | starship, custodian of the 19 | stolen plans that can save 20 | her people and restore 21 | freedom to the galaxy.... 22 | -------------------------------------------------------------------------------- /extra_files/test_files/text/attack_of_the_clones.txt: -------------------------------------------------------------------------------- 1 | There is unrest in the Galactic 2 | Senate. Several thousand solar 3 | systems have declared their 4 | intentions to leave the Republic. 5 | 6 | This separatist movement, 7 | under the leadership of the 8 | mysterious Count Dooku, has 9 | made it difficult for the limited 10 | number of Jedi Knights to maintain 11 | peace and order in the galaxy. 12 | 13 | Senator Amidala, the former 14 | Queen of Naboo, is returning 15 | to the Galactic Senate to vote 16 | on the critical issue of creating 17 | an ARMY OF THE REPUBLIC 18 | to assist the overwhelmed 19 | Jedi.... 20 | -------------------------------------------------------------------------------- /extra_files/test_files/text/return_of_the_jedi.txt: -------------------------------------------------------------------------------- 1 | Luke Skywalker has returned to 2 | his home planet of Tatooine in 3 | an attempt to rescue his 4 | friend Han Solo from the 5 | clutches of the vile gangster 6 | Jabba the Hutt. 7 | 8 | Little does Luke know that the 9 | GALACTIC EMPIRE has secretly 10 | begun construction on a new 11 | armored space station even 12 | more powerful than the first 13 | dreaded Death Star. 14 | 15 | When completed, this ultimate 16 | weapon will spell certain doom 17 | for the small band of rebels 18 | struggling to restore freedom 19 | to the galaxy... 20 | 21 | -------------------------------------------------------------------------------- /extra_files/test_files/text/revenge_of_the_sith.txt: -------------------------------------------------------------------------------- 1 | War! The Republic is crumbling 2 | under attacks by the ruthless 3 | Sith Lord, Count Dooku. 4 | There are heroes on both sides. 5 | Evil is everywhere. 6 | 7 | In a stunning move, the 8 | fiendish droid leader, General 9 | Grievous, has swept into the 10 | Republic capital and kidnapped 11 | Chancellor Palpatine, leader of 12 | the Galactic Senate. 13 | 14 | As the Separatist Droid Army 15 | attempts to flee the besieged 16 | capital with their valuable 17 | hostage, two Jedi Knights lead a 18 | desperate mission to rescue the 19 | captive Chancellor.... 20 | -------------------------------------------------------------------------------- /extra_files/test_files/text/the_empire_strikes_back.txt: -------------------------------------------------------------------------------- 1 | It is a dark time for the 2 | Rebellion. Although the Death 3 | Star has been destroyed, 4 | Imperial troops have driven the 5 | Rebel forces from their hidden 6 | base and pursued them across 7 | the galaxy. 8 | 9 | Evading the dreaded Imperial 10 | Starfleet, a group of freedom 11 | fighters led by Luke Skywalker 12 | has established a new secret 13 | base on the remote ice world 14 | of Hoth. 15 | 16 | The evil lord Darth Vader, 17 | obsessed with finding young 18 | Skywalker, has dispatched 19 | thousands of remote probes into 20 | the far reaches of space.... 21 | -------------------------------------------------------------------------------- /extra_files/test_files/text/the_force_awakens.txt: -------------------------------------------------------------------------------- 1 | Luke Skywalker has vanished. 2 | In his absence, the sinister 3 | FIRST ORDER has risen from 4 | the ashes of the Empire 5 | and will not rest until 6 | Skywalker, the last Jedi, 7 | has been destroyed. 8 | 9 | With the support of the 10 | REPUBLIC, General Leia Organa 11 | leads a brave RESISTANCE. 12 | She is desperate to find her 13 | brother Luke and gain his 14 | help in restoring peace 15 | and justice to the galaxy. 16 | 17 | Leia has sent her most daring 18 | pilot on a secret mission 19 | to Jakku, where an old ally 20 | has discovered a clue to 21 | Luke's whereabouts.... 22 | -------------------------------------------------------------------------------- /extra_files/test_files/text/the_last_jedi.txt: -------------------------------------------------------------------------------- 1 | The FIRST ORDER reigns. 2 | Having decimated the peaceful 3 | Republic, Supreme Leader Snoke 4 | now deploys his merciless 5 | legions to seize military 6 | control of the galaxy. 7 | 8 | Only General Leia Organa's 9 | band of RESISTANCE fighters 10 | stand against the rising 11 | tyranny, certain that Jedi 12 | Master Luke Skywalker will 13 | return and restore a spark of 14 | hope to the fight. 15 | 16 | But the Resistance has been 17 | exposed. As the First Order 18 | speeds toward the rebel base, 19 | the brave heroes mount a 20 | desperate escape.... 21 | -------------------------------------------------------------------------------- /extra_files/test_files/text/the_phantom_menace.txt: -------------------------------------------------------------------------------- 1 | Turmoil has engulfed the 2 | Galactic Republic. The taxation 3 | of trade routes to outlying star 4 | systems is in dispute. 5 | 6 | Hoping to resolve the matter 7 | with a blockade of deadly 8 | battleships, the greedy Trade 9 | Federation has stopped all 10 | shipping to the small planet 11 | of Naboo. 12 | 13 | While the Congress of the 14 | Republic endlessly debates 15 | this alarming chain of events, 16 | the Supreme Chancellor has 17 | secretly dispatched two Jedi 18 | Knights, the guardians of 19 | peace and justice in the 20 | galaxy, to settle the conflict.... 21 | -------------------------------------------------------------------------------- /extra_files/test_files/text/the_rise_of_skywalker.txt: -------------------------------------------------------------------------------- 1 | The dead speak! The galaxy has 2 | heard a mysterious broadcast, 3 | a threat of REVENGE in the 4 | sinister voice of the late 5 | EMPEROR PALPATINE. 6 | 7 | GENERAL LEIA ORGANA 8 | dispatches secret agents to 9 | gather intelligence, while REY, 10 | the last hope of the Jedi, trains 11 | for battle against the diabolical 12 | FIRST ORDER. 13 | 14 | Meanwhile, Supreme Leader 15 | KYLO REN rages in search 16 | of the phantom Emperor, 17 | determined to destroy any 18 | threat to his power.... 19 | -------------------------------------------------------------------------------- /extra_files/test_files/zork_dat/dtextc.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theseus-os/Theseus/1fbfe567075a65ed749b6680db1aeb538819c70c/extra_files/test_files/zork_dat/dtextc.dat -------------------------------------------------------------------------------- /extra_files/wasm/exorbitant.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theseus-os/Theseus/1fbfe567075a65ed749b6680db1aeb538819c70c/extra_files/wasm/exorbitant.wasm -------------------------------------------------------------------------------- /extra_files/wasm/grep.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theseus-os/Theseus/1fbfe567075a65ed749b6680db1aeb538819c70c/extra_files/wasm/grep.wasm -------------------------------------------------------------------------------- /extra_files/wasm/hello.cwasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theseus-os/Theseus/1fbfe567075a65ed749b6680db1aeb538819c70c/extra_files/wasm/hello.cwasm -------------------------------------------------------------------------------- /extra_files/wasm/pee.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theseus-os/Theseus/1fbfe567075a65ed749b6680db1aeb538819c70c/extra_files/wasm/pee.wasm -------------------------------------------------------------------------------- /extra_files/wasm/zork.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theseus-os/Theseus/1fbfe567075a65ed749b6680db1aeb538819c70c/extra_files/wasm/zork.wasm -------------------------------------------------------------------------------- /github_pages/.gitignore: -------------------------------------------------------------------------------- 1 | # Specify any content here to exclude it from GitHub Pages. 2 | -------------------------------------------------------------------------------- /github_pages/README.md: -------------------------------------------------------------------------------- 1 | # Published Documentation 2 | 3 | This directory contains files used to publish Theseus's documentation online, which is realized using GitHub Pages at [https://theseus-os.github.io/Theseus](https://theseus-os.github.io/Theseus). 4 | 5 | Any file in this directory is included in the published output (e.g., `index.html`), unless it is explicitly added to the local `.gitignore` file here. 6 | 7 | ## Automatically Generated Directories 8 | 9 | When building Theseus's book and source code documentation (rustdoc) automtically using GitHub Actions, the `book/` and `doc/` directories are generated here. Those directories are ignored by git in the top-level `.gitignore` file. 10 | -------------------------------------------------------------------------------- /github_pages/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |

Theseus Documentation

5 | 6 |

Welcome to the online docs for Theseus! There are two kinds of docs available:

7 | 11 | 12 |

You can also check out the main Theseus README file for a quick start guide.

13 | -------------------------------------------------------------------------------- /kernel/acpi/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["Kevin Boos "] 3 | name = "acpi" 4 | description = "ACPI (Advanced Configuration and Power Interface) support for Theseus" 5 | version = "0.1.0" 6 | edition = "2021" 7 | 8 | [dependencies] 9 | spin = "0.9.4" 10 | log = "0.4.8" 11 | 12 | [dependencies.memory] 13 | path = "../memory" 14 | 15 | [dependencies.acpi_table] 16 | path = "acpi_table" 17 | 18 | [dependencies.acpi_table_handler] 19 | path = "acpi_table_handler" 20 | 21 | [dependencies.rsdp] 22 | path = "rsdp" 23 | 24 | [dependencies.rsdt] 25 | path = "rsdt" 26 | 27 | [dependencies.fadt] 28 | path = "fadt" 29 | 30 | [dependencies.waet] 31 | path = "waet" 32 | 33 | [dependencies.madt] 34 | path = "madt" 35 | 36 | [dependencies.hpet] 37 | path = "hpet" 38 | 39 | [dependencies.dmar] 40 | path = "dmar" 41 | 42 | [dependencies.iommu] 43 | path = "../iommu" 44 | 45 | [dependencies.time] 46 | path = "../time" 47 | 48 | [lib] 49 | crate-type = ["rlib"] 50 | -------------------------------------------------------------------------------- /kernel/acpi/acpi_table/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "acpi_table" 3 | version = "0.1.0" 4 | authors = ["Kevin Boos "] 5 | description = "Definitions for ACPI tables bookkeeping" 6 | edition = "2021" 7 | 8 | [dependencies] 9 | zerocopy = "0.5.0" 10 | 11 | [dependencies.log] 12 | version = "0.4.8" 13 | 14 | [dependencies.memory] 15 | path = "../../memory" 16 | 17 | [dependencies.sdt] 18 | path = "../sdt" 19 | -------------------------------------------------------------------------------- /kernel/acpi/acpi_table_handler/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "acpi_table_handler" 3 | version = "0.1.0" 4 | authors = ["Kevin Boos "] 5 | description = "Functions for handling specific types of ACPI tables" 6 | edition = "2021" 7 | 8 | [dependencies.log] 9 | version = "0.4.8" 10 | 11 | [dependencies.memory] 12 | path = "../../memory" 13 | 14 | [dependencies.acpi_table] 15 | path = "../acpi_table" 16 | 17 | [dependencies.rsdt] 18 | path = "../rsdt" 19 | 20 | [dependencies.fadt] 21 | path = "../fadt" 22 | 23 | [dependencies.waet] 24 | path = "../waet" 25 | 26 | [dependencies.hpet] 27 | path = "../hpet" 28 | 29 | [dependencies.madt] 30 | path = "../madt" 31 | 32 | [dependencies.dmar] 33 | path = "../dmar" 34 | -------------------------------------------------------------------------------- /kernel/acpi/dmar/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "dmar" 3 | version = "0.1.0" 4 | authors = ["Kevin Boos "] 5 | description = "Support for ACPI DMAR" 6 | edition = "2021" 7 | 8 | [dependencies] 9 | zerocopy = "0.5.0" 10 | log = "0.4.8" 11 | 12 | [dependencies.memory] 13 | path = "../../memory" 14 | 15 | [dependencies.sdt] 16 | path = "../sdt" 17 | 18 | [dependencies.acpi_table] 19 | path = "../acpi_table" 20 | -------------------------------------------------------------------------------- /kernel/acpi/fadt/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "fadt" 3 | version = "0.1.0" 4 | authors = ["Kevin Boos "] 5 | description = "Support for ACPI FADT" 6 | edition = "2021" 7 | 8 | [dependencies] 9 | zerocopy = "0.5.0" 10 | 11 | [dependencies.memory] 12 | path = "../../memory" 13 | 14 | [dependencies.sdt] 15 | path = "../sdt" 16 | 17 | [dependencies.acpi_table] 18 | path = "../acpi_table" 19 | 20 | -------------------------------------------------------------------------------- /kernel/acpi/hpet/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "hpet" 3 | version = "0.1.0" 4 | authors = ["Kevin Boos "] 5 | description = "Support for the x86 HPET: High Precision Event Timer" 6 | edition = "2021" 7 | 8 | [dependencies] 9 | spin = "0.9.4" 10 | volatile = "0.2.7" 11 | zerocopy = "0.5.0" 12 | 13 | [dependencies.log] 14 | version = "0.4.8" 15 | 16 | [dependencies.kernel_config] 17 | path = "../../kernel_config" 18 | 19 | [dependencies.memory] 20 | path = "../../memory" 21 | 22 | [dependencies.sdt] 23 | path = "../sdt" 24 | 25 | [dependencies.acpi_table] 26 | path = "../acpi_table" 27 | 28 | [dependencies.time] 29 | path = "../../time" 30 | -------------------------------------------------------------------------------- /kernel/acpi/madt/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "madt" 3 | version = "0.1.0" 4 | authors = ["Kevin Boos "] 5 | description = "Support for ACPI MADT" 6 | edition = "2021" 7 | 8 | [dependencies] 9 | zerocopy = "0.5.0" 10 | log = "0.4.8" 11 | 12 | [dependencies.memory] 13 | path = "../../memory" 14 | 15 | [dependencies.pic] 16 | path = "../../pic" 17 | 18 | [dependencies.apic] 19 | path = "../../apic" 20 | 21 | [dependencies.ioapic] 22 | path = "../../ioapic" 23 | 24 | [dependencies.sdt] 25 | path = "../sdt" 26 | 27 | [dependencies.acpi_table] 28 | path = "../acpi_table" 29 | -------------------------------------------------------------------------------- /kernel/acpi/rsdp/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "rsdp" 3 | version = "0.1.0" 4 | authors = ["Kevin Boos "] 5 | description = "Support for ACPI RSDP" 6 | edition = "2021" 7 | 8 | [dependencies] 9 | zerocopy = "0.5.0" 10 | 11 | [dependencies.memory] 12 | path = "../../memory" 13 | -------------------------------------------------------------------------------- /kernel/acpi/rsdt/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "rsdt" 3 | version = "0.1.0" 4 | authors = ["Kevin Boos "] 5 | description = "Support for ACPI RSDT and XSDT" 6 | edition = "2021" 7 | 8 | [dependencies.memory] 9 | path = "../../memory" 10 | 11 | [dependencies.sdt] 12 | path = "../sdt" 13 | 14 | [dependencies.acpi_table] 15 | path = "../acpi_table" 16 | -------------------------------------------------------------------------------- /kernel/acpi/sdt/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "sdt" 3 | version = "0.1.0" 4 | authors = ["Kevin Boos "] 5 | description = "Support for ACPI SDT and other descriptor tables" 6 | edition = "2021" 7 | 8 | [dependencies] 9 | zerocopy = "0.5.0" 10 | -------------------------------------------------------------------------------- /kernel/acpi/waet/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "waet" 3 | version = "0.1.0" 4 | authors = ["Kevin Boos "] 5 | description = "Support for ACPI WAET" 6 | edition = "2021" 7 | 8 | [dependencies] 9 | zerocopy = "0.5.0" 10 | 11 | [dependencies.memory] 12 | path = "../../memory" 13 | 14 | [dependencies.sdt] 15 | path = "../sdt" 16 | 17 | [dependencies.acpi_table] 18 | path = "../acpi_table" 19 | 20 | -------------------------------------------------------------------------------- /kernel/ap_start/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["Kevin Boos "] 3 | name = "ap_start" 4 | description = "High-level initialization code that runs on each AP (core) after it has booted up" 5 | version = "0.1.0" 6 | edition = "2021" 7 | 8 | [dependencies] 9 | log = "0.4.8" 10 | 11 | irq_safety = { git = "https://github.com/theseus-os/irq_safety" } 12 | sync_irq = { path = "../../libs/sync_irq" } 13 | memory = { path = "../memory" } 14 | stack = { path = "../stack" } 15 | interrupts = { path = "../interrupts" } 16 | scheduler = { path = "../scheduler" } 17 | spawn = { path = "../spawn" } 18 | kernel_config = { path = "../kernel_config" } 19 | cls_allocator = { path = "../cls_allocator" } 20 | cpu = { path = "../cpu" } 21 | no_drop = { path = "../no_drop" } 22 | early_tls = { path = "../early_tls" } 23 | 24 | [target.'cfg(target_arch = "x86_64")'.dependencies] 25 | page_attribute_table = { path = "../page_attribute_table" } 26 | apic = { path = "../apic" } 27 | 28 | [lib] 29 | crate-type = ["rlib"] 30 | -------------------------------------------------------------------------------- /kernel/app_io/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "app_io" 3 | version = "0.1.0" 4 | authors = ["Zhiyao Ma "] 5 | description = "Offers applications the ability to read from or print to the terminal." 6 | edition = "2021" 7 | 8 | 9 | [dependencies] 10 | hashbrown = "0.11" 11 | core2 = { version = "0.4.0", default-features = false, features = ["alloc", "nightly"] } 12 | logger = { path = "../logger" } 13 | 14 | [dependencies.task] 15 | path = "../../kernel/task" 16 | 17 | [dependencies.stdio] 18 | path = "../../libs/stdio" 19 | 20 | [dependencies.sync_block] 21 | path = "../../kernel/sync_block" 22 | 23 | [dependencies.tty] 24 | path = "../../kernel/tty" 25 | 26 | [dependencies.lazy_static] 27 | features = ["spin_no_std"] 28 | version = "1.4.0" 29 | 30 | [lib] 31 | crate-type = ["rlib"] 32 | -------------------------------------------------------------------------------- /kernel/arm_boards/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["Nathan Royer "] 3 | name = "arm_boards" 4 | description = "Board-specific configuration and definitions for aarch64 systems" 5 | version = "0.1.0" 6 | edition = "2021" 7 | 8 | [dependencies] 9 | cfg-if = "1.0.0" 10 | memory_structs = { path = "../memory_structs" } 11 | derive_more = "0.99.0" 12 | 13 | [features] 14 | default = [ "qemu_virt" ] 15 | qemu_virt = [] 16 | 17 | [lib] 18 | crate-type = ["rlib"] 19 | -------------------------------------------------------------------------------- /kernel/arm_boards/src/boards/unselected.rs: -------------------------------------------------------------------------------- 1 | //! Invalid board config file that throws a compile error if a board config wasn't selected. 2 | 3 | compile_error!("Please select a board config feature in the arm_boards crate"); 4 | -------------------------------------------------------------------------------- /kernel/arm_boards/src/mpidr.rs: -------------------------------------------------------------------------------- 1 | use derive_more::{Display, Binary, Octal, LowerHex, UpperHex}; 2 | 3 | /// A unique identifier for a CPU, hardcoded in `arm_boards`. 4 | #[derive( 5 | Clone, Copy, Debug, Display, PartialEq, Eq, PartialOrd, Ord, 6 | Hash, Binary, Octal, LowerHex, UpperHex, 7 | )] 8 | #[repr(transparent)] 9 | pub struct DefinedMpidrValue(u64); 10 | 11 | impl DefinedMpidrValue { 12 | /// Returns the contained value 13 | pub fn value(self) -> u64 { 14 | self.0 15 | } 16 | 17 | /// Create an `MpidrValue` from its four affinity numbers 18 | pub(crate) const fn new(aff3: u8, aff2: u8, aff1: u8, aff0: u8) -> Self { 19 | let aff3 = (aff3 as u64) << 32; 20 | let aff2 = (aff2 as u64) << 16; 21 | let aff1 = (aff1 as u64) << 8; 22 | let aff0 = aff0 as u64; 23 | Self(aff3 | aff2 | aff1 | aff0) 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /kernel/ata/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["Kevin Boos "] 3 | name = "ata" 4 | description = "Storage device driver for ATA (IDE) disks" 5 | version = "0.1.0" 6 | edition = "2018" 7 | 8 | [dependencies] 9 | bitflags = "2.4.1" 10 | log = "0.4.8" 11 | spin = "0.9.4" 12 | x86_64 = "0.14.8" 13 | 14 | [dependencies.port_io] 15 | path = "../../libs/port_io" 16 | 17 | [dependencies.interrupts] 18 | path = "../interrupts" 19 | 20 | [dependencies.pci] 21 | path = "../pci" 22 | 23 | [dependencies.storage_device] 24 | path = "../storage_device" 25 | 26 | [dependencies.io] 27 | path = "../io" 28 | 29 | 30 | [lib] 31 | crate-type = ["rlib"] 32 | -------------------------------------------------------------------------------- /kernel/block_allocator/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["Philipp Oppermann ", "Ramla Ijaz "] 3 | name = "block_cache" 4 | description = "A generic layer for caching block-based streams." 5 | version = "0.1.0" 6 | 7 | [dependencies] 8 | 9 | [dependencies.log] 10 | version = "0.4.8" 11 | 12 | [dependencies.lazy_static] 13 | features = ["spin_no_std"] 14 | version = "1.4.0" 15 | 16 | [dependencies.hashbrown] 17 | version = "0.11.2" 18 | features = ["nightly"] 19 | 20 | [dependencies.storage_device] 21 | path = "../storage_device" 22 | 23 | [lib] 24 | crate-type = ["rlib"] 25 | -------------------------------------------------------------------------------- /kernel/boot_info/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "boot_info" 3 | version = "0.1.0" 4 | authors = ["Klim Tsoutsman "] 5 | description = "Abstraction over multiboot2 and UEFI boot information" 6 | edition = "2021" 7 | 8 | [dependencies] 9 | bitflags = "2.4.1" 10 | kernel_config = { path = "../kernel_config" } 11 | memory_structs = { path = "../memory_structs" } 12 | multiboot2 = { version = "0.14", optional = true } 13 | 14 | [dependencies.uefi-bootloader-api] 15 | git = "https://github.com/theseus-os/uefi-bootloader" 16 | optional = true 17 | 18 | [features] 19 | uefi = ["dep:uefi-bootloader-api"] 20 | multiboot2 = ["dep:multiboot2"] 21 | -------------------------------------------------------------------------------- /kernel/bootloader_modules/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["Kevin Boos "] 3 | name = "bootloader_modules" 4 | description = "A type abstration for modules provided by a bootloader, e.g., multiboot" 5 | version = "0.1.0" 6 | 7 | [dependencies.memory_structs] 8 | path = "../memory_structs" 9 | 10 | [lib] 11 | crate-type = ["rlib"] 12 | -------------------------------------------------------------------------------- /kernel/catch_unwind/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["Kevin Boos "] 3 | name = "catch_unwind" 4 | description = "Support for catching unwinding after a panic, like `std::panic::catch_unwind`" 5 | version = "0.1.0" 6 | 7 | [dependencies.log] 8 | version = "0.4.8" 9 | 10 | [dependencies.unwind] 11 | path = "../unwind" 12 | 13 | [dependencies.task] 14 | path = "../task" 15 | 16 | [lib] 17 | crate-type = ["rlib"] 18 | -------------------------------------------------------------------------------- /kernel/cls/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "cls" 3 | version = "0.1.0" 4 | authors = ["Klim Tsoutsman "] 5 | description = "Library for defining CPU-local variables" 6 | edition = "2021" 7 | 8 | [dependencies] 9 | cls_macros = { path = "cls_macros" } 10 | irq_safety = { git = "https://github.com/theseus-os/irq_safety" } 11 | preemption = { path = "../preemption" } 12 | 13 | [target.'cfg(target_arch = "x86_64")'.dependencies] 14 | x86_64 = "0.14.8" 15 | 16 | [target.'cfg(target_arch = "aarch64")'.dependencies] 17 | tock-registers = "0.7.0" 18 | cortex-a = "7.5.0" 19 | -------------------------------------------------------------------------------- /kernel/cls/cls_macros/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "cls_macros" 3 | version = "0.1.0" 4 | authors = ["Klim Tsoutsman "] 5 | description = "Macros for the `cls` crate" 6 | edition = "2021" 7 | 8 | [lib] 9 | proc-macro = true 10 | 11 | [dependencies] 12 | convert_case = "0.6.0" 13 | proc-macro2 = "1.0.56" 14 | quote = "1.0.26" 15 | # "full" feature necessary to parse unsafe blocks 16 | syn = { version = "2.0.13", features = ["full"] } 17 | -------------------------------------------------------------------------------- /kernel/cls_allocator/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "cls_allocator" 3 | version = "0.1.0" 4 | authors = ["Klim Tsoutsman "] 5 | description = "Allocator for CPU-local storage" 6 | edition = "2021" 7 | 8 | [dependencies] 9 | cpu = { path = "../cpu" } 10 | crate_metadata = { path = "../crate_metadata" } 11 | irq_safety = { git = "https://github.com/theseus-os/irq_safety" } 12 | local_storage_initializer = { path = "../local_storage_initializer" } 13 | sync_spin = { path = "../../libs/sync_spin" } 14 | -------------------------------------------------------------------------------- /kernel/color/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "color" 3 | version = "0.1.0" 4 | authors = ["Wenqiu Yu ", "Kevin Boos "] 5 | description = "A simple representation of the standard RGB color model" 6 | 7 | [lib] 8 | crate-type = ["rlib"] 9 | -------------------------------------------------------------------------------- /kernel/compositor/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "compositor" 3 | version = "0.1.0" 4 | authors = ["Wenqiu Yu "] 5 | description = "a compositor trait which composites a list of buffers to a single buffer" 6 | 7 | [dependencies.framebuffer] 8 | path = "../framebuffer" 9 | 10 | [dependencies.shapes] 11 | path = "../shapes" 12 | 13 | [lib] 14 | crate-type = ["rlib"] 15 | -------------------------------------------------------------------------------- /kernel/context_switch/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["Kevin Boos "] 3 | name = "context_switch" 4 | description = "Top-level wrapper crate for managing all possible configurations for context switching routines and structs" 5 | version = "0.1.0" 6 | edition = "2021" 7 | 8 | [dependencies] 9 | cfg-if = "0.1.6" 10 | context_switch_regular = { path = "../context_switch_regular" } 11 | 12 | [target.'cfg(target_arch = "x86_64")'.dependencies] 13 | context_switch_sse = { path = "../context_switch_sse" } 14 | context_switch_avx = { path = "../context_switch_avx" } 15 | 16 | [lib] 17 | crate-type = ["rlib"] 18 | -------------------------------------------------------------------------------- /kernel/context_switch_avx/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["Kevin Boos "] 3 | name = "context_switch_avx" 4 | description = "Context switching routines and structs for AVX-enabled register sets" 5 | version = "0.1.0" 6 | 7 | [dependencies] 8 | zerocopy = "0.5.0" 9 | 10 | [dependencies.context_switch_regular] 11 | path = "../context_switch_regular" 12 | 13 | [lib] 14 | crate-type = ["rlib"] 15 | -------------------------------------------------------------------------------- /kernel/context_switch_regular/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["Kevin Boos ", "Nathan Royer "] 3 | name = "context_switch_regular" 4 | description = "Context switching routines and structs for regular (non-SSE) register sets" 5 | version = "0.1.0" 6 | 7 | [dependencies] 8 | zerocopy = "0.5.0" 9 | 10 | [lib] 11 | crate-type = ["rlib"] 12 | -------------------------------------------------------------------------------- /kernel/context_switch_regular/src/lib.rs: -------------------------------------------------------------------------------- 1 | #![no_std] 2 | #![feature(naked_functions)] 3 | 4 | extern crate zerocopy; 5 | 6 | #[cfg(target_arch = "x86_64")] 7 | #[path = "x86_64.rs"] 8 | mod arch; 9 | 10 | #[cfg(target_arch = "aarch64")] 11 | #[path = "aarch64.rs"] 12 | mod arch; 13 | 14 | pub use arch::*; -------------------------------------------------------------------------------- /kernel/context_switch_sse/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["Kevin Boos "] 3 | name = "context_switch_sse" 4 | description = "Context switching routines and structs for SSE-enabled register sets" 5 | version = "0.1.0" 6 | 7 | [dependencies] 8 | zerocopy = "0.5.0" 9 | 10 | [dependencies.context_switch_regular] 11 | path = "../context_switch_regular" 12 | 13 | [lib] 14 | crate-type = ["rlib"] 15 | -------------------------------------------------------------------------------- /kernel/cpu/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["Nathan Royer "] 3 | name = "cpu" 4 | description = "An abstraction for querying about CPUs (cores) in an SMP multicore system." 5 | version = "0.1.0" 6 | edition = "2021" 7 | 8 | [dependencies] 9 | derive_more = "0.99.0" 10 | 11 | [target.'cfg(target_arch = "x86_64")'.dependencies] 12 | apic = { path = "../apic" } 13 | 14 | [target.'cfg(target_arch = "aarch64")'.dependencies] 15 | sync_irq = { path = "../../libs/sync_irq" } 16 | arm_boards = { path = "../arm_boards" } 17 | tock-registers = "0.7.0" 18 | cortex-a = "7.5.0" 19 | 20 | [lib] 21 | crate-type = ["rlib"] 22 | -------------------------------------------------------------------------------- /kernel/crate_metadata_serde/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "crate_metadata_serde" 3 | version = "0.1.0" 4 | description = "Standalone types that represent (de)serializable crate metadata structures" 5 | authors = ["Kevin Boos "] 6 | edition = "2018" 7 | 8 | [dependencies.hashbrown] 9 | version = "0.11.2" 10 | features = ["nightly", "serde"] 11 | 12 | [dependencies.serde] 13 | version = "1.0.137" 14 | default-features = false 15 | features = ["alloc", "derive"] 16 | 17 | -------------------------------------------------------------------------------- /kernel/crate_name_utils/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["Kevin Boos "] 3 | name = "crate_name_utils" 4 | description = "Utility functions for processing, parsing, and working with crate names/symbol strings" 5 | version = "0.1.0" 6 | 7 | [dependencies.itertools] 8 | version = "0.7.9" 9 | default-features = false 10 | 11 | [dependencies.path] 12 | path = "../path" 13 | 14 | [dependencies.crate_metadata] 15 | path = "../crate_metadata" 16 | -------------------------------------------------------------------------------- /kernel/crate_swap/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "crate_swap" 3 | version = "0.1.0" 4 | description = "Handles crate swapping for live evolution and fault recovery purposes" 5 | authors = ["Kevin Boos "] 6 | 7 | 8 | [dependencies] 9 | spin = "0.9.4" 10 | qp-trie = "0.8.1" 11 | by_address = "1.0.4" 12 | 13 | 14 | [dependencies.log] 15 | version = "0.4.8" 16 | 17 | [dependencies.lazy_static] 18 | features = ["spin_no_std"] 19 | version = "1.4.0" 20 | 21 | [dependencies.hashbrown] 22 | version = "0.11.2" 23 | features = ["nightly"] 24 | 25 | [dependencies.memory] 26 | path = "../memory" 27 | 28 | [dependencies.fs_node] 29 | path = "../fs_node" 30 | 31 | [dependencies.path] 32 | path = "../path" 33 | 34 | [dependencies.mod_mgmt] 35 | path = "../mod_mgmt" 36 | 37 | [dependencies.hpet] 38 | path = "../acpi/hpet" 39 | 40 | [lib] 41 | crate-type = ["rlib"] 42 | -------------------------------------------------------------------------------- /kernel/deferred_interrupt_tasks/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["Kevin Boos "] 3 | name = "deferred_interrupt_tasks" 4 | description = "Abstractions for deferred interrupt handler tasks" 5 | version = "0.1.0" 6 | edition = "2021" 7 | 8 | [dependencies] 9 | log = "0.4.8" 10 | 11 | task = { path = "../task" } 12 | scheduler = { path = "../scheduler" } 13 | spawn = { path = "../spawn" } 14 | interrupts = { path = "../interrupts" } 15 | debugit = { path = "../../libs/debugit" } 16 | 17 | [lib] 18 | crate-type = ["rlib"] 19 | -------------------------------------------------------------------------------- /kernel/displayable/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "displayable" 3 | version = "0.1.0" 4 | authors = ["Wenqiu Yu "] 5 | description = "provides a Displayable trait, which abstracts objects that can display themselves onto a framebuffer" 6 | 7 | [dependencies] 8 | spin = "0.9.4" 9 | 10 | [dependencies.framebuffer] 11 | path = "../framebuffer" 12 | 13 | [dependencies.color] 14 | path = "../color" 15 | 16 | [dependencies.shapes] 17 | path = "../shapes" 18 | 19 | [lib] 20 | crate-type = ["rlib"] 21 | -------------------------------------------------------------------------------- /kernel/displayable/text_display/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "text_display" 3 | version = "0.1.0" 4 | authors = ["Wenqiu Yu "] 5 | description = "a text display is a block of text which can display onto a framebuffer" 6 | 7 | [dependencies] 8 | spin = "0.9.4" 9 | 10 | [dependencies.framebuffer] 11 | path = "../../framebuffer" 12 | 13 | [dependencies.displayable] 14 | path = "../" 15 | 16 | [dependencies.framebuffer_printer] 17 | path = "../../framebuffer_printer" 18 | 19 | [dependencies.font] 20 | path = "../../font" 21 | 22 | [dependencies.shapes] 23 | path = "../../shapes" 24 | 25 | [dependencies.color] 26 | path = "../../color" 27 | 28 | [lib] 29 | crate-type = ["rlib"] 30 | -------------------------------------------------------------------------------- /kernel/dreadnought/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "dreadnought" 3 | version = "0.1.0" 4 | authors = ["Klim Tsoutsman "] 5 | description = "An asynchronous executor" 6 | edition = "2021" 7 | 8 | [dependencies] 9 | sleep = { path = "../sleep" } 10 | spawn = { path = "../spawn" } 11 | task = { path = "../task" } 12 | time = { path = "../time" } 13 | waker = { path = "../waker" } 14 | 15 | [dependencies.futures] 16 | version = "0.3" 17 | default-features = false 18 | features = ["alloc", "async-await"] 19 | -------------------------------------------------------------------------------- /kernel/early_printer/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["Kevin Boos "] 3 | name = "early_printer" 4 | description = "Basic support for displaying ASCII text on screen during early boot/init" 5 | version = "0.1.0" 6 | edition = "2021" 7 | 8 | [dependencies] 9 | spin = "0.9.4" 10 | log = "0.4.8" 11 | volatile = "0.2.7" 12 | 13 | boot_info = { path = "../boot_info" } 14 | font = { path = "../font" } 15 | memory = { path = "../memory" } 16 | 17 | [target.'cfg(target_arch = "x86_64")'.dependencies] 18 | page_attribute_table = { path = "../page_attribute_table" } 19 | vga_buffer = { path = "../vga_buffer" } 20 | 21 | [features] 22 | bios = [] 23 | 24 | [lib] 25 | crate-type = ["rlib"] 26 | -------------------------------------------------------------------------------- /kernel/early_tls/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["Kevin Boos "] 3 | name = "early_tls" 4 | description = "Handles initialization of TLS data images during early OS initialization" 5 | version = "0.1.0" 6 | edition = "2021" 7 | 8 | [dependencies] 9 | spin = "0.9.4" 10 | 11 | local_storage_initializer = { path = "../local_storage_initializer" } 12 | 13 | -------------------------------------------------------------------------------- /kernel/environment/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "environment" 3 | version = "0.1.0" 4 | authors = ["christinewang5 "] 5 | edition = "2021" 6 | 7 | [dependencies] 8 | fs_node = { path = "../fs_node" } 9 | hashbrown = "0.11.2" 10 | path = { path = "../path" } 11 | root = { path = "../root" } 12 | -------------------------------------------------------------------------------- /kernel/event_types/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["Kevin Boos "] 3 | name = "event_types" 4 | description = "Types of input and output events that flow throughout the system" 5 | version = "0.1.0" 6 | edition = "2021" 7 | 8 | [dependencies.keycodes_ascii] 9 | path = "../../libs/keycodes_ascii" 10 | 11 | [dependencies.shapes] 12 | path = "../shapes" 13 | 14 | [dependencies.mouse_data] 15 | path = "../../libs/mouse_data" 16 | 17 | [lib] 18 | crate-type = ["rlib"] 19 | -------------------------------------------------------------------------------- /kernel/exceptions_early/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["Kevin Boos "] 3 | name = "exceptions_early" 4 | description = "Early exception handlers that do nothing but print an error and hang." 5 | version = "0.1.0" 6 | edition = "2018" 7 | 8 | [dependencies] 9 | x86_64 = "0.14.8" 10 | spin = "0.9.4" 11 | locked_idt = { path = "../../libs/locked_idt" } 12 | 13 | [dependencies.memory] 14 | path = "../memory" 15 | 16 | [dependencies.early_printer] 17 | path = "../early_printer" 18 | 19 | [dependencies.mod_mgmt] 20 | path = "../mod_mgmt" 21 | 22 | [dependencies.tss] 23 | path = "../tss" 24 | 25 | [dependencies.gdt] 26 | path = "../gdt" 27 | 28 | 29 | [lib] 30 | crate-type = ["rlib"] 31 | -------------------------------------------------------------------------------- /kernel/external_unwind_info/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["Kevin Boos "] 3 | name = "external_unwind_info" 4 | description = "Registers and stores unwind info from external or legacy components, à la libunwind" 5 | version = "0.1.0" 6 | edition = "2018" 7 | 8 | [dependencies] 9 | log = "0.4.8" 10 | spin = "0.9.4" 11 | 12 | [dependencies.memory] 13 | path = "../memory" 14 | -------------------------------------------------------------------------------- /kernel/fault_crate_swap/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "fault_crate_swap" 3 | version = "0.1.0" 4 | description = "Handles crate swapping of fault crates for fault tolerance purposes" 5 | authors = ["Namitha Liyanage "] 6 | 7 | 8 | [dependencies.log] 9 | default-features = false 10 | version = "0.4.8" 11 | 12 | [dependencies.memory] 13 | path = "../memory" 14 | 15 | [dependencies.fs_node] 16 | path = "../fs_node" 17 | 18 | [dependencies.path] 19 | path = "../path" 20 | 21 | [dependencies.mod_mgmt] 22 | path = "../mod_mgmt" 23 | 24 | [dependencies.crate_swap] 25 | path = "../crate_swap" 26 | 27 | [dependencies.task] 28 | path = "../task" 29 | 30 | [dependencies.fault_log] 31 | path = "../fault_log" 32 | 33 | [lib] 34 | crate-type = ["rlib"] 35 | -------------------------------------------------------------------------------- /kernel/fault_log/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "fault_log" 3 | version = "0.1.0" 4 | description = "Logs all exceptions occuring in Theseus" 5 | authors = ["Namitha Liyanage "] 6 | edition = "2021" 7 | 8 | [dependencies.sync_irq] 9 | path = "../../libs/sync_irq" 10 | 11 | [dependencies.memory] 12 | path = "../memory" 13 | 14 | [dependencies.early_printer] 15 | path = "../early_printer" 16 | 17 | [dependencies.app_io] 18 | path = "../app_io" 19 | 20 | [dependencies.task] 21 | path = "../task" 22 | 23 | [dependencies.cpu] 24 | path = "../cpu" 25 | 26 | [dependencies.log] 27 | default-features = false 28 | version = "0.4.8" 29 | 30 | -------------------------------------------------------------------------------- /kernel/font/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "font" 3 | version = "0.1.0" 4 | authors = ["Wenqiu Yu "] 5 | description = "define and initialize the bitmaps of ASCII characters" 6 | 7 | [dependencies] 8 | spin = "0.9.4" 9 | 10 | [lib] 11 | crate-type = ["rlib"] 12 | -------------------------------------------------------------------------------- /kernel/frame_allocator/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["Kevin Boos "] 3 | name = "frame_allocator" 4 | description = "The allocator for physical memory frames." 5 | version = "0.1.0" 6 | edition = "2021" 7 | 8 | [dependencies] 9 | log = "0.4.8" 10 | spin = "0.9.4" 11 | intrusive-collections = "0.9.0" 12 | static_assertions = "1.1.0" 13 | 14 | range_inclusive = { path = "../../libs/range_inclusive" } 15 | 16 | kernel_config = { path = "../kernel_config" } 17 | memory_structs = { path = "../memory_structs" } 18 | -------------------------------------------------------------------------------- /kernel/framebuffer/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "framebuffer" 3 | version = "0.1.0" 4 | authors = ["Kevin Boos ", "Wenqiu Yu "] 5 | description = "a framebuffer is a buffer of pixels which can be composited to another framebuffer or be mapped to some physical memory" 6 | edition = "2021" 7 | 8 | [dependencies] 9 | log = "0.4.8" 10 | zerocopy = "0.5.0" 11 | 12 | color = { path = "../color" } 13 | early_printer = { path = "../early_printer" } 14 | memory = { path = "../memory" } 15 | multicore_bringup = { path = "../multicore_bringup" } 16 | shapes = { path = "../shapes" } 17 | 18 | [target.'cfg(target_arch = "x86_64")'.dependencies] 19 | page_attribute_table = { path = "../page_attribute_table" } 20 | -------------------------------------------------------------------------------- /kernel/framebuffer_compositor/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "framebuffer_compositor" 3 | version = "0.1.0" 4 | authors = ["Wenqiu Yu "] 5 | description = "the framebuffer compositor composites multiple source framebuffers into one destination framebuffer" 6 | 7 | [dependencies] 8 | spin = "0.9.4" 9 | 10 | [dependencies.framebuffer] 11 | path = "../framebuffer" 12 | 13 | [dependencies.shapes] 14 | path = "../shapes" 15 | 16 | [dependencies.compositor] 17 | path = "../compositor" 18 | 19 | [dependencies.hashbrown] 20 | version = "0.11.2" 21 | features = ["nightly"] 22 | 23 | [lib] 24 | crate-type = ["rlib"] 25 | -------------------------------------------------------------------------------- /kernel/framebuffer_drawer/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "framebuffer_drawer" 3 | version = "0.1.0" 4 | authors = ["Wenqiu Yu "] 5 | description = "basic draw interfaces" 6 | 7 | [dependencies.framebuffer] 8 | path = "../framebuffer" 9 | 10 | [dependencies.shapes] 11 | path = "../shapes" 12 | 13 | [lib] 14 | crate-type = ["rlib"] 15 | -------------------------------------------------------------------------------- /kernel/framebuffer_printer/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "framebuffer_printer" 3 | version = "0.1.0" 4 | authors = ["Wenqiu Yu "] 5 | description = "print a string in a framebuffer" 6 | 7 | [dependencies.framebuffer] 8 | path = "../framebuffer" 9 | 10 | [dependencies.font] 11 | path = "../font" 12 | 13 | [dependencies.shapes] 14 | path = "../shapes" 15 | 16 | [lib] 17 | crate-type = ["rlib"] 18 | -------------------------------------------------------------------------------- /kernel/fs_node/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "fs_node" 3 | version = "0.1.0" 4 | authors = ["Andrew Pham , Christine Wang "] 3 | name = "gdt" 4 | description = "GDT (Global Descriptor Table) support (x86 only) for Theseus" 5 | version = "0.1.0" 6 | edition = "2021" 7 | 8 | [dependencies] 9 | spin = "0.9.4" 10 | x86_64 = "0.14.8" 11 | bit_field = "0.7.0" 12 | bitflags = "2.4.1" 13 | log = "0.4.8" 14 | 15 | [dependencies.atomic_linked_list] 16 | path = "../../libs/atomic_linked_list" 17 | 18 | [dependencies.memory] 19 | path = "../memory" 20 | 21 | [dependencies.tss] 22 | path = "../tss" 23 | 24 | [dependencies.cpu] 25 | path = "../cpu" 26 | -------------------------------------------------------------------------------- /kernel/generic_timer_aarch64/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = [ 3 | "Nathan Royer ", 4 | "Kevin Boos "] 3 | description = "Allows configuring the Generic Interrupt Controller" 4 | version = "0.1.0" 5 | edition = "2021" 6 | name = "gic" 7 | 8 | [dependencies] 9 | zerocopy = "0.5.0" 10 | volatile = "0.2.7" 11 | spin = "0.9.4" 12 | log = "0.4.8" 13 | 14 | memory = { path = "../memory" } 15 | cpu = { path = "../cpu" } 16 | arm_boards = { path = "../arm_boards" } 17 | -------------------------------------------------------------------------------- /kernel/gic/src/lib.rs: -------------------------------------------------------------------------------- 1 | //! Arm Generic Interrupt Controller Support 2 | //! 3 | //! The GIC is an extension to ARMv8 which allows routing and 4 | //! filtering interrupts in a single or multi-core system. 5 | //! 6 | //! The term "Forwarding" is sometimes used in this crate. 7 | //! This is because the Distributor, Redistributor and CPU interface are 8 | //! chained in the controller. The distributor and the redistributor are 9 | //! configured by the code of this crate to either allow (forward) 10 | //! interrupts or disallow (discard) them. 11 | 12 | #![no_std] 13 | #![feature(doc_cfg)] 14 | 15 | #[cfg(target_arch = "aarch64")] 16 | mod gic; 17 | 18 | #[cfg(target_arch = "aarch64")] 19 | pub use gic::*; 20 | -------------------------------------------------------------------------------- /kernel/heap/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["Ramla Ijaz "] 3 | name = "heap" 4 | description = "global allocator for the system" 5 | version = "0.1.0" 6 | 7 | [dependencies] 8 | spin = "0.9.4" 9 | 10 | [dependencies.log] 11 | version = "0.4.8" 12 | 13 | [dependencies.sync_irq] 14 | path = "../../libs/sync_irq" 15 | 16 | [dependencies.memory] 17 | path = "../memory" 18 | 19 | [dependencies.kernel_config] 20 | path = "../kernel_config" 21 | 22 | [dependencies.block_allocator] 23 | path = "../block_allocator" 24 | -------------------------------------------------------------------------------- /kernel/heapfile/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "heapfile" 3 | version = "0.1.0" 4 | authors = ["Kevin Boos "] 5 | description = "An implementation of in-memory files, backed by heap memory" 6 | 7 | 8 | [dependencies] 9 | spin = "0.9.4" 10 | 11 | [dependencies.fs_node] 12 | path = "../fs_node" 13 | 14 | [dependencies.memory] 15 | path = "../memory" 16 | 17 | [dependencies.log] 18 | version = "0.4.8" 19 | 20 | [dependencies.io] 21 | path = "../io" 22 | 23 | [dependencies.irq_safety] 24 | git = "https://github.com/theseus-os/irq_safety" 25 | 26 | [lib] 27 | crate-type = ["rlib"] 28 | -------------------------------------------------------------------------------- /kernel/http_client/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["Kevin Boos "] 3 | name = "http_client" 4 | description = "Functions for creating and sending HTTP requests and receiving responses" 5 | version = "0.1.0" 6 | edition = "2021" 7 | 8 | [dependencies] 9 | httparse = { version = "1.3.3", default-features = false } 10 | log = "0.4.8" 11 | net = { path = "../net" } 12 | percent-encoding = { path = "../../libs/percent_encoding" } 13 | time = { path = "../time" } 14 | -------------------------------------------------------------------------------- /kernel/idle/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "idle" 3 | version = "0.1.0" 4 | authors = ["Klim Tsoutsman "] 5 | description = "CPU idle management" 6 | edition = "2021" 7 | 8 | [dependencies] 9 | cfg-if = "1.0.0" 10 | raw-cpuid = "10.6.0" 11 | -------------------------------------------------------------------------------- /kernel/idle/src/arch/mod.rs: -------------------------------------------------------------------------------- 1 | cfg_if::cfg_if! { 2 | if #[cfg(target_arch = "x86_64")] { 3 | mod x86_64; 4 | pub use self::x86_64::*; 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /kernel/idle/src/arch/x86_64/mod.rs: -------------------------------------------------------------------------------- 1 | mod intel; 2 | 3 | /// A CPU idle state. 4 | #[derive(Clone, Copy, Debug)] 5 | pub struct IdleState { 6 | /// The name of the idle state. 7 | pub name: &'static str, 8 | /// The value of EAX when calling MWAIT to enter the idle state. 9 | pub eax: usize, 10 | /// Whether entering the state flushes the TLB. 11 | pub tlb_flushed: bool, 12 | /// The amount of time it takes for the CPU to exit the idle state in 13 | /// microseconds. 14 | pub exit_latency: usize, 15 | /// The amount of time the CPU must spend in the idle state to justify 16 | /// entering the idle state in microseconds. 17 | /// 18 | /// For C1, this is equivalent to the exit latency. For other idle states, 19 | /// it is roughly three times the exit latency. 20 | pub target_residency: usize, 21 | } 22 | 23 | pub fn idle_states() -> Option<&'static [crate::IdleState]> { 24 | Some(intel::Model::current()?.idle_states()) 25 | } 26 | -------------------------------------------------------------------------------- /kernel/idle/src/lib.rs: -------------------------------------------------------------------------------- 1 | //! CPU idle management. 2 | //! 3 | //! Currently, this crate is incomplete. In future it will provide an idle loop 4 | //! which dynamically selects a sleep state for the CPU based on a set of 5 | //! heuristics. 6 | 7 | #![no_std] 8 | 9 | mod arch; 10 | 11 | pub use arch::*; 12 | -------------------------------------------------------------------------------- /kernel/intel_ethernet/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "intel_ethernet" 3 | description = "defines structs and traits for DMA descriptors unique to Intel NICs" 4 | version = "0.1.0" 5 | authors = ["Ramla-I "] 6 | 7 | [dependencies] 8 | volatile = "0.2.7" 9 | bit_field = "0.7.0" 10 | zerocopy = "0.5.0" 11 | 12 | [dependencies.memory] 13 | path = "../memory" 14 | 15 | [dependencies.log] 16 | version = "0.4.8" 17 | 18 | 19 | [lib] 20 | crate-type = ["rlib"] 21 | -------------------------------------------------------------------------------- /kernel/interrupt_controller/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "interrupt_controller" 3 | version = "0.1.0" 4 | authors = [ 5 | "Nathan Royer ", 6 | "Kevin Boos ", 7 | ] 8 | description = "Cross-platform abstraction over interrupt controllers" 9 | edition = "2021" 10 | 11 | [dependencies] 12 | log = "0.4.8" 13 | cpu = { path = "../cpu" } 14 | memory = { path = "../memory" } 15 | spin = "0.9.4" 16 | sync_irq = { path = "../../libs/sync_irq" } 17 | 18 | [target.'cfg(target_arch = "aarch64")'.dependencies] 19 | arm_boards = { path = "../arm_boards" } 20 | generic_timer_aarch64 = { path = "../generic_timer_aarch64" } 21 | gic = { path = "../gic" } 22 | 23 | [target.'cfg(target_arch = "x86_64")'.dependencies] 24 | acpi = { path = "../acpi" } 25 | apic = { path = "../apic" } 26 | ioapic = { path = "../ioapic" } 27 | madt = { path = "../acpi/madt" } 28 | -------------------------------------------------------------------------------- /kernel/interrupts/src/lib.rs: -------------------------------------------------------------------------------- 1 | //! Basic interrupt handling structures and simple handler routines. 2 | 3 | #![no_std] 4 | #![cfg_attr(target_arch = "x86_64", feature(abi_x86_interrupt))] 5 | #![cfg_attr(target_arch = "x86_64", allow(dead_code))] 6 | 7 | #[cfg_attr(target_arch = "x86_64", path = "x86_64/mod.rs")] 8 | #[cfg_attr(target_arch = "aarch64", path = "aarch64/mod.rs")] 9 | mod arch; 10 | 11 | pub use arch::*; 12 | 13 | #[derive(Debug, PartialEq, Eq)] 14 | #[repr(C)] 15 | pub enum EoiBehaviour { 16 | /// The interrupt handler hasn't called the [`eoi`] function, 17 | /// in which case it will be called automatically once the 18 | /// handler returns. 19 | HandlerDidNotSendEoi, 20 | /// The interrupt handler has called the [`eoi`] function. 21 | HandlerSentEoi, 22 | } 23 | -------------------------------------------------------------------------------- /kernel/io/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["Kevin Boos "] 3 | name = "io" 4 | description = "Traits and types for reading and writing IO streams, of both block-wise and byte-wise granularity." 5 | version = "0.1.0" 6 | 7 | [dependencies] 8 | core2 = { version = "0.4.0", default-features = false, features = ["alloc", "nightly"] } 9 | delegate = "0.6.0" 10 | spin = "0.9.4" 11 | 12 | [dependencies.log] 13 | default-features = false 14 | version = "0.4.8" 15 | 16 | [dependencies.lazy_static] 17 | features = ["spin_no_std"] 18 | version = "1.4.0" 19 | 20 | [dependencies.lockable] 21 | path = "../../libs/lockable" 22 | 23 | [lib] 24 | crate-type = ["rlib"] 25 | -------------------------------------------------------------------------------- /kernel/ioapic/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["Kevin Boos "] 3 | name = "ioapic" 4 | description = "IOAPIC (I/O Advanced Programmable Interrupt Controller) support on x86_64 for Theseus" 5 | version = "0.1.0" 6 | edition = "2021" 7 | 8 | [dependencies] 9 | log = "0.4.8" 10 | spin = "0.9.4" 11 | volatile = "0.2.7" 12 | zerocopy = "0.5.0" 13 | 14 | atomic_linked_list = { path = "../../libs/atomic_linked_list" } 15 | 16 | apic = { path = "../apic" } 17 | memory = { path = "../memory" } 18 | -------------------------------------------------------------------------------- /kernel/iommu/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "iommu" 3 | version = "0.1.0" 4 | authors = ["Nicholas Lindsay "] 5 | description = "Intel VT-d IOMMU support" 6 | 7 | [dependencies] 8 | log = "0.4.8" 9 | spin = "0.9.4" 10 | volatile = "0.2.7" 11 | zerocopy = "0.5.0" 12 | bitflags = "2.4.1" 13 | 14 | [dependencies.sync_irq] 15 | path = "../../libs/sync_irq" 16 | 17 | [dependencies.memory] 18 | path = "../memory" 19 | 20 | [lib] 21 | crate-type = ["rlib"] 22 | -------------------------------------------------------------------------------- /kernel/kernel_config/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["Kevin Boos "] 3 | name = "kernel_config" 4 | description = "configuration values and settings used in the Theseus kernel, e.g., timeslices, memory layouts, etc" 5 | version = "0.1.0" 6 | 7 | [lib] 8 | crate-type = ["rlib"] 9 | -------------------------------------------------------------------------------- /kernel/kernel_config/src/display.rs: -------------------------------------------------------------------------------- 1 | /// The maximum resolution `(width, height)` of the graphical framebuffer, in pixels. 2 | /// This is a **requested limit** and does not control what the actual 3 | /// resolution of the graphical framebuffer will be. 4 | /// 5 | /// We recommend matching this to the value set in 6 | /// `kernel/nano_core/src/asm/bios/multiboot_header.asm`, 7 | /// but it's not strictly necessary to do so. 8 | pub const FRAMEBUFFER_MAX_RESOLUTION: (u16, u16) = (1280, 1024); 9 | -------------------------------------------------------------------------------- /kernel/kernel_config/src/lib.rs: -------------------------------------------------------------------------------- 1 | #![no_std] 2 | 3 | pub mod memory; 4 | pub mod time; 5 | pub mod display; -------------------------------------------------------------------------------- /kernel/kernel_config/src/time.rs: -------------------------------------------------------------------------------- 1 | 2 | 3 | /// the chosen interrupt frequency (in Hertz) of the PIT clock 4 | pub const CONFIG_PIT_FREQUENCY_HZ: u32 = 1000; 5 | 6 | /// the chosen interrupt frequency (in Hertz) of the RTC. 7 | /// valid values are powers of 2, from 2 Hz up to 8192 Hz 8 | /// see [change_rtc_frequency()](rtc/) 9 | pub const CONFIG_RTC_FREQUENCY_HZ: usize = 128; 10 | 11 | /// The timeslice period, specified in microseconds. 12 | pub const CONFIG_TIMESLICE_PERIOD_MICROSECONDS: u32 = 8000; // 8ms 13 | 14 | /// the heartbeat period in milliseconds 15 | pub const CONFIG_HEARTBEAT_PERIOD_MS: usize = 10000; -------------------------------------------------------------------------------- /kernel/keyboard/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["Kevin Boos , Hecatia Elegua"] 3 | name = "keyboard" 4 | description = "A basic driver for keyboards connected to the legacy PS/2 port" 5 | version = "0.1.0" 6 | edition = "2021" 7 | 8 | [dependencies] 9 | spin = "0.9.4" 10 | x86_64 = "0.14.8" 11 | mpmc = "0.1.6" 12 | log = "0.4.8" 13 | once_cell = { version = "1", default-features = false } 14 | 15 | [dependencies.keycodes_ascii] 16 | path = "../../libs/keycodes_ascii" 17 | 18 | [dependencies.event_types] 19 | path = "../event_types" 20 | 21 | [dependencies.ps2] 22 | path = "../ps2" 23 | 24 | [dependencies.interrupts] 25 | path = "../interrupts" 26 | 27 | 28 | [lib] 29 | crate-type = ["rlib"] 30 | -------------------------------------------------------------------------------- /kernel/libtest/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["Ramla Ijaz "] 3 | name = "libtest" 4 | description = "A set of convenience functions that can be used for benchmarking within Theseus." 5 | version = "0.1.0" 6 | 7 | [dependencies] 8 | spin = "0.9.4" 9 | bit_field = "0.10.0" 10 | libm = "0.2.1" 11 | 12 | [dependencies.apic] 13 | path = "../apic" 14 | 15 | [dependencies.cpu] 16 | path = "../cpu" 17 | 18 | [dependencies.log] 19 | version = "0.4.8" 20 | 21 | [dependencies.memory] 22 | path = "../memory" 23 | 24 | [dependencies.task] 25 | path = "../task" 26 | 27 | [dependencies.hpet] 28 | path = "../acpi/hpet" 29 | 30 | [dependencies.pmu_x86] 31 | path = "../pmu_x86" 32 | 33 | [dependencies.hashbrown] 34 | version = "0.11.2" 35 | features = ["nightly"] 36 | 37 | [lib] 38 | crate-type = ["rlib"] 39 | -------------------------------------------------------------------------------- /kernel/local_storage_initializer/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["Kevin Boos "] 3 | name = "local_storage_initializer" 4 | description = "Generates data images for TLS and CLS areas" 5 | version = "0.1.0" 6 | edition = "2021" 7 | 8 | [dependencies] 9 | log = "0.4.8" 10 | spin = "0.9.4" 11 | rangemap = { version = "1.3.0", features = [ "const_fn" ] } 12 | 13 | crate_metadata = { path = "../crate_metadata" } 14 | memory_structs = { path = "../memory_structs" } 15 | 16 | 17 | [target.'cfg(target_arch = "x86_64")'.dependencies] 18 | x86_64 = "0.14.8" 19 | 20 | [target.'cfg(target_arch = "aarch64")'.dependencies] 21 | cortex-a = "7.5.0" 22 | tock-registers = "0.7.0" 23 | -------------------------------------------------------------------------------- /kernel/logger/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["Kevin Boos "] 3 | name = "logger" 4 | version = "0.1.0" 5 | 6 | [dependencies] 7 | log = "0.4.8" 8 | crossbeam-utils = { version = "0.8.12", default-features = false } 9 | 10 | [dependencies.sync_irq] 11 | path = "../../libs/sync_irq" 12 | 13 | [dependencies.serial_port_basic] 14 | path = "../serial_port_basic" 15 | 16 | [lib] 17 | crate-type = ["rlib"] 18 | -------------------------------------------------------------------------------- /kernel/memfs/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "memfs" 3 | version = "0.1.0" 4 | authors = ["Andrew Pham , Christine Wang ", "Nathan Royer "] 3 | name = "memory_aarch64" 4 | description = "The memory subsystem interfaces on aarch64." 5 | version = "0.1.0" 6 | edition = "2021" 7 | 8 | [dependencies] 9 | log = "0.4.8" 10 | cortex-a = "7.5.0" 11 | tock-registers = "0.7.0" 12 | 13 | boot_info = { path = "../boot_info" } 14 | pte_flags = { path = "../pte_flags" } 15 | kernel_config = { path = "../kernel_config" } 16 | memory_structs = { path = "../memory_structs" } -------------------------------------------------------------------------------- /kernel/memory_initialization/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["Ramla Ijaz "] 3 | name = "memory_initialization" 4 | description = "Initialization routine for the virtual memory subsystem." 5 | version = "0.1.0" 6 | edition = "2021" 7 | 8 | [dependencies] 9 | log = "0.4.8" 10 | 11 | boot_info = { path = "../boot_info" } 12 | early_printer = { path = "../early_printer" } 13 | memory = { path = "../memory" } 14 | stack = { path = "../stack" } 15 | no_drop = { path = "../no_drop" } 16 | kernel_config = { path = "../kernel_config" } 17 | bootloader_modules = { path = "../bootloader_modules" } 18 | heap = { path = "../heap" } 19 | 20 | irq_safety = { git = "https://github.com/theseus-os/irq_safety" } 21 | -------------------------------------------------------------------------------- /kernel/memory_structs/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["Kevin Boos "] 3 | name = "memory_structs" 4 | description = "Basic types used for memory management" 5 | version = "0.1.0" 6 | edition = "2021" 7 | 8 | [dependencies] 9 | zerocopy = "0.5.0" 10 | derive_more = "0.99.0" 11 | paste = "1.0.5" 12 | 13 | kernel_config = { path = "../kernel_config" } 14 | range_inclusive = { path = "../../libs/range_inclusive" } 15 | -------------------------------------------------------------------------------- /kernel/memory_x86_64/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["Kevin Boos "] 3 | name = "memory_x86_64" 4 | description = "The memory subsystem interfaces on x86_64." 5 | version = "0.1.0" 6 | edition = "2021" 7 | 8 | [dependencies] 9 | x86_64 = "0.14.8" 10 | log = "0.4.8" 11 | 12 | boot_info = { path = "../boot_info" } 13 | pte_flags = { path = "../pte_flags" } 14 | kernel_config = { path = "../kernel_config" } 15 | memory_structs = { path = "../memory_structs" } 16 | 17 | [lib] 18 | crate-type = ["rlib"] 19 | -------------------------------------------------------------------------------- /kernel/mlx5/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["Ramla Ijaz "] 3 | name = "mlx5" 4 | description = "Driver for the Mellanox ConnectX-5 NIC" 5 | version = "0.1.0" 6 | 7 | [dependencies] 8 | spin = "0.9.4" 9 | libm = "0.2.1" 10 | mpmc = "0.1.6" 11 | 12 | [dependencies.log] 13 | version = "0.4.8" 14 | 15 | [dependencies.sync_irq] 16 | path = "../../libs/sync_irq" 17 | 18 | [dependencies.memory] 19 | path = "../memory" 20 | 21 | [dependencies.pci] 22 | path = "../pci" 23 | 24 | [dependencies.nic_initialization] 25 | path = "../nic_initialization" 26 | 27 | [dependencies.mlx_ethernet] 28 | path = "../mlx_ethernet" 29 | 30 | [dependencies.kernel_config] 31 | path = "../kernel_config" 32 | 33 | [dependencies.memory_structs] 34 | path = "../memory_structs" 35 | 36 | [dependencies.nic_buffers] 37 | path = "../nic_buffers" 38 | 39 | [dependencies.lazy_static] 40 | features = ["spin_no_std"] 41 | version = "1.4.0" 42 | 43 | [lib] 44 | crate-type = ["rlib"] 45 | -------------------------------------------------------------------------------- /kernel/mlx_ethernet/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "mlx_ethernet" 3 | description = "defines structs and traits for SW objects unique to Mellanox NICs" 4 | version = "0.1.0" 5 | authors = ["Ramla-I "] 6 | 7 | [dependencies] 8 | volatile = "0.2.7" 9 | bit_field = "0.7.0" 10 | zerocopy = "0.5.0" 11 | byteorder = { version = "1.4.3", default-features = false } 12 | libm = "0.2.1" 13 | mpmc = "0.1.6" 14 | 15 | [dependencies.num_enum] 16 | version = "0.5.2" 17 | default-features = false 18 | 19 | [dependencies.memory] 20 | path = "../memory" 21 | 22 | [dependencies.kernel_config] 23 | path = "../kernel_config" 24 | 25 | [dependencies.nic_buffers] 26 | path = "../nic_buffers" 27 | 28 | [dependencies.log] 29 | version = "0.4.8" 30 | 31 | [lib] 32 | crate-type = ["rlib"] 33 | -------------------------------------------------------------------------------- /kernel/mouse/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["Bowen Liu ", "Kevin Boos ", "Hecatia Elegua"] 3 | name = "mouse" 4 | description = "A basic driver for a mouse connected to the legacy PS/2 port" 5 | version = "0.1.0" 6 | edition = "2021" 7 | 8 | [dependencies] 9 | spin = "0.9.4" 10 | mpmc = "0.1.6" 11 | log = "0.4.8" 12 | x86_64 = "0.14.8" 13 | 14 | [dependencies.mouse_data] 15 | path = "../../libs/mouse_data" 16 | 17 | [dependencies.interrupts] 18 | path = "../interrupts" 19 | 20 | [dependencies.ps2] 21 | path = "../ps2" 22 | 23 | [dependencies.event_types] 24 | path = "../event_types" 25 | 26 | [lib] 27 | crate-type = ["rlib"] 28 | -------------------------------------------------------------------------------- /kernel/multicore_bringup/src/lib.rs: -------------------------------------------------------------------------------- 1 | //! Initialization and bring-up of secondary CPUs. 2 | //! 3 | //! These functions are intended to be invoked from the BSP 4 | //! (the Bootstrap Processor, the main CPU in x86 terms) 5 | //! in order to bring up secondary CPUs (APs in x86 terms). 6 | 7 | #![no_std] 8 | #![cfg_attr(target_arch = "x86_64", feature(let_chains))] 9 | #![cfg_attr(target_arch = "aarch64", feature(naked_functions))] 10 | 11 | #[cfg_attr(target_arch = "x86_64", path = "x86_64.rs")] 12 | #[cfg_attr(target_arch = "aarch64", path = "aarch64.rs")] 13 | mod arch; 14 | 15 | pub use arch::*; 16 | -------------------------------------------------------------------------------- /kernel/multiple_heaps/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["Ramla Ijaz "] 3 | name = "multiple_heaps" 4 | description = "Allocator which uses multiple heaps" 5 | version = "0.1.0" 6 | 7 | [dependencies] 8 | intrusive-collections = "0.9.0" 9 | cfg-if = "0.1.6" 10 | spin = "0.9.4" 11 | 12 | 13 | [dependencies.sync_irq] 14 | path = "../../libs/sync_irq" 15 | 16 | [dependencies.log] 17 | version = "0.4.8" 18 | 19 | [dependencies.memory] 20 | path = "../memory" 21 | 22 | [dependencies.page_allocator] 23 | path = "../page_allocator" 24 | 25 | [dependencies.kernel_config] 26 | path = "../kernel_config" 27 | 28 | [dependencies.apic] 29 | path = "../apic" 30 | 31 | [dependencies.slabmalloc] 32 | path = "../slabmalloc" 33 | 34 | [dependencies.slabmalloc_safe] 35 | path = "../slabmalloc_safe" 36 | 37 | [dependencies.slabmalloc_unsafe] 38 | path = "../slabmalloc_unsafe" 39 | 40 | [dependencies.heap] 41 | path = "../heap" 42 | 43 | [dependencies.hashbrown] 44 | version = "0.11.2" 45 | features = ["nightly"] 46 | -------------------------------------------------------------------------------- /kernel/nano_core/src/stack_smash_protection.rs: -------------------------------------------------------------------------------- 1 | 2 | //! Simple C-compatible function that panics after a stack smash has occurred. 3 | //! 4 | //! This is used by C compiler instrumentation for C code that was compiled with 5 | //! support for stack smashing protection. 6 | //! Basically, when a stack smash is detected, the `__stack_chk_fail()` function 7 | //! is invoked as a callback, which may take a variety of actions to report 8 | //! the stack smashing error. 9 | //! 10 | //! OSdev wiki page: 11 | 12 | /// See module docs. This shouldn't be invoked directly, but it's safe to do so 13 | /// because all it does is panic. 14 | #[no_mangle] 15 | pub extern "C" fn __stack_chk_fail() -> ! { 16 | panic!("__stack_chk_fail: Stack smashing detected!"); 17 | } 18 | -------------------------------------------------------------------------------- /kernel/net/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "net" 3 | version = "0.1.0" 4 | description = "Network device abstractions" 5 | edition = "2021" 6 | 7 | [dependencies] 8 | heapless = "0.7.8" 9 | log = "0.4.8" 10 | nic_buffers = { path = "../nic_buffers" } 11 | rand = { version = "0.8.5", default-features = false } 12 | random = { path = "../random" } 13 | rand_chacha = { version = "0.3.1", default-features = false } 14 | spin = "0.9" 15 | sync_block = { path = "../sync_block" } 16 | sync_irq = { path = "../../libs/sync_irq" } 17 | 18 | [dependencies.smoltcp] 19 | version = "0.10" 20 | default-features = false 21 | features = [ 22 | "alloc", 23 | "socket-raw", 24 | "socket-udp", 25 | "socket-tcp", 26 | "socket-icmp", 27 | "proto-ipv4", 28 | "proto-ipv6", 29 | "medium-ethernet", 30 | ] -------------------------------------------------------------------------------- /kernel/nic_buffers/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "nic_buffers" 3 | description = "Structs for network transmit and receive buffers" 4 | version = "0.1.0" 5 | authors = ["Kevin Boos "] 6 | 7 | [dependencies] 8 | mpmc = "0.1.6" 9 | 10 | [dependencies.memory] 11 | path = "../memory" 12 | 13 | [dependencies.log] 14 | version = "0.4.8" 15 | 16 | 17 | [lib] 18 | crate-type = ["rlib"] 19 | -------------------------------------------------------------------------------- /kernel/nic_initialization/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["Kevin Boos ", "Ramla Ijaz "] 3 | name = "nic_initialization" 4 | description = "A set of functions used to initialize a Network Interface Card" 5 | version = "0.1.0" 6 | 7 | [dependencies] 8 | volatile = "0.2.7" 9 | mpmc = "0.1.6" 10 | 11 | [dependencies.log] 12 | version = "0.4.8" 13 | 14 | [dependencies.memory] 15 | path = "../memory" 16 | 17 | [dependencies.intel_ethernet] 18 | path = "../intel_ethernet" 19 | 20 | [dependencies.nic_buffers] 21 | path = "../nic_buffers" 22 | 23 | [dependencies.nic_queues] 24 | path = "../nic_queues" 25 | 26 | 27 | [lib] 28 | crate-type = ["rlib"] 29 | -------------------------------------------------------------------------------- /kernel/nic_queues/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "nic_queues" 3 | description = "Defines structs that hold all information related to nic receive and transmit queues" 4 | version = "0.1.0" 5 | authors = ["Ramla-I "] 6 | 7 | [dependencies] 8 | mpmc = "0.1.6" 9 | 10 | [dependencies.memory] 11 | path = "../memory" 12 | 13 | [dependencies.log] 14 | version = "0.4.8" 15 | 16 | [dependencies.intel_ethernet] 17 | path = "../intel_ethernet" 18 | 19 | [dependencies.nic_buffers] 20 | path = "../nic_buffers" 21 | 22 | [dependencies.cpu] 23 | path = "../cpu" 24 | 25 | [lib] 26 | crate-type = ["rlib"] 27 | -------------------------------------------------------------------------------- /kernel/no_drop/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["Kevin Boos "] 3 | name = "no_drop" 4 | description = "Simple wrapper type for preventing an object from being dropped" 5 | version = "0.1.0" 6 | -------------------------------------------------------------------------------- /kernel/ota_update_client/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["Kevin Boos "] 3 | name = "ota_update_client" 4 | description = "Implements network communication with a build server to acquire live updates over the air" 5 | version = "0.1.0" 6 | 7 | [dependencies] 8 | httparse = { version = "1.3.3", default-features = false } 9 | sha3 = { version = "0.10.5", default-features = false } 10 | 11 | [dependencies.log] 12 | version = "0.4.8" 13 | 14 | [dependencies.irq_safety] 15 | git = "https://github.com/theseus-os/irq_safety" 16 | 17 | [dependencies.spawn] 18 | path = "../spawn" 19 | 20 | [dependencies.task] 21 | path = "../task" 22 | 23 | [dependencies.time] 24 | path = "../time" 25 | 26 | [dependencies.net] 27 | path = "../net" 28 | 29 | [dependencies.http_client] 30 | path = "../http_client" 31 | 32 | [dependencies.percent-encoding] 33 | path = "../../libs/percent_encoding" 34 | 35 | [dependencies.itertools] 36 | version = "0.7.9" 37 | default-features = false 38 | -------------------------------------------------------------------------------- /kernel/page_allocator/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["Kevin Boos "] 3 | name = "page_allocator" 4 | description = "The allocator for virtual memory pages." 5 | version = "0.1.0" 6 | 7 | [dependencies] 8 | spin = "0.9.4" 9 | intrusive-collections = "0.9.0" 10 | static_assertions = "1.1.0" 11 | 12 | [dependencies.log] 13 | version = "0.4.8" 14 | 15 | [dependencies.kernel_config] 16 | path = "../kernel_config" 17 | 18 | [dependencies.memory_structs] 19 | path = "../memory_structs" 20 | 21 | [lib] 22 | crate-type = ["rlib"] 23 | -------------------------------------------------------------------------------- /kernel/page_attribute_table/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["Kevin Boos "] 3 | name = "page_attribute_table" 4 | description = "Support for x86 Page Attribute Table (PAT) for controlling memory type cacheability" 5 | version = "0.1.0" 6 | edition = "2018" 7 | 8 | [dependencies] 9 | log = "0.4.8" 10 | spin = "0.9.4" 11 | x86_64 = "0.14.8" 12 | modular-bitfield = "0.11.2" 13 | 14 | [dependencies.msr] 15 | path = "../../libs/msr" 16 | 17 | [dependencies.raw-cpuid] 18 | version = "10.6.0" 19 | 20 | [lib] 21 | crate-type = ["rlib"] 22 | -------------------------------------------------------------------------------- /kernel/page_table_entry/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["Kevin Boos "] 3 | name = "page_table_entry" 4 | description = "Defines the structure of page table entries on x86_64" 5 | version = "0.1.0" 6 | edition = "2018" 7 | 8 | [dependencies] 9 | zerocopy = "0.5.0" 10 | 11 | frame_allocator = { path = "../frame_allocator" } 12 | memory_structs = { path = "../memory_structs" } 13 | kernel_config = { path = "../kernel_config" } 14 | pte_flags = { path = "../pte_flags" } 15 | 16 | [lib] 17 | crate-type = ["rlib"] 18 | -------------------------------------------------------------------------------- /kernel/panic_entry/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["Kevin Boos "] 3 | name = "panic_entry" 4 | description = "Contains the lang items and entry points for panics and other errors/exceptions, as required by the Rust compiler." 5 | version = "0.1.0" 6 | edition = "2021" 7 | 8 | [dependencies] 9 | log = "0.4.8" 10 | 11 | memory = { path = "../memory" } 12 | mod_mgmt = { path = "../mod_mgmt" } 13 | panic_wrapper = { path = "../panic_wrapper" } 14 | 15 | [target.'cfg(target_arch = "x86_64")'.dependencies] 16 | early_printer = { path = "../early_printer" } 17 | unwind = { path = "../unwind" } 18 | 19 | [lib] 20 | crate-type = ["rlib"] 21 | -------------------------------------------------------------------------------- /kernel/panic_wrapper/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["Kevin Boos "] 3 | name = "panic_wrapper" 4 | description = "Wrapper functions for handling and propagating panics" 5 | version = "0.1.0" 6 | edition = "2021" 7 | ## Currently, this crate only needs the build script for frame_pointers. 8 | build = "../stack_trace_frame_pointers/build.rs" 9 | 10 | [dependencies] 11 | log = "0.4.8" 12 | 13 | fault_log = { path = "../fault_log" } 14 | memory = { path = "../memory" } 15 | mod_mgmt = { path = "../mod_mgmt" } 16 | task = { path = "../task" } 17 | 18 | [target.'cfg(target_arch = "x86_64")'.dependencies] 19 | stack_trace = { path = "../stack_trace" } 20 | stack_trace_frame_pointers = { path = "../stack_trace_frame_pointers" } 21 | unwind = { path = "../unwind" } 22 | 23 | [lib] 24 | crate-type = ["rlib"] 25 | -------------------------------------------------------------------------------- /kernel/path/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "path" 3 | version = "0.1.0" 4 | authors = ["Andrew Pham , Christine Wang "] 5 | description = "File system path manipulation" 6 | edition = "2021" 7 | 8 | [dependencies] 9 | fs_node = { path = "../fs_node" } 10 | root = { path = "../root" } 11 | -------------------------------------------------------------------------------- /kernel/pci/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["Kevin Boos "] 3 | name = "pci" 4 | description = "Basic PCI support for Theseus." 5 | version = "0.1.0" 6 | edition = "2021" 7 | 8 | [dependencies] 9 | spin = "0.9.4" 10 | bit_field = "0.7.0" 11 | log = "0.4.8" 12 | volatile = "0.2.4" 13 | zerocopy = "0.5.0" 14 | 15 | memory = { path = "../memory" } 16 | cpu = { path = "../cpu" } 17 | interrupts = { path = "../interrupts" } 18 | 19 | [target.'cfg(target_arch = "x86_64")'.dependencies] 20 | port_io = { path = "../../libs/port_io" } 21 | 22 | [target.'cfg(target_arch = "aarch64")'.dependencies] 23 | arm_boards = { path = "../arm_boards" } 24 | interrupt_controller = { path = "../interrupt_controller" } 25 | 26 | [lib] 27 | crate-type = ["rlib"] 28 | -------------------------------------------------------------------------------- /kernel/physical_nic/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["Ramla Ijaz "] 3 | name = "physical_nic" 4 | description = "A trait that defines functions a physical NIC has to implement to support virtualization" 5 | version = "0.1.0" 6 | 7 | [dependencies] 8 | 9 | [dependencies.nic_buffers] 10 | path = "../nic_buffers" 11 | 12 | [dependencies.nic_queues] 13 | path = "../nic_queues" 14 | 15 | [dependencies.intel_ethernet] 16 | path = "../intel_ethernet" 17 | 18 | [lib] 19 | crate-type = ["rlib"] 20 | -------------------------------------------------------------------------------- /kernel/pic/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["Kevin Boos "] 3 | name = "pic" 4 | description = "PIC (Programmable Interrupt Controller), support for a legacy device that isn't used much" 5 | version = "0.1.0" 6 | 7 | [dependencies] 8 | log = "0.4.8" 9 | 10 | [dependencies.port_io] 11 | path = "../../libs/port_io" 12 | 13 | 14 | [lib] 15 | crate-type = ["rlib"] 16 | -------------------------------------------------------------------------------- /kernel/pit_clock/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["Kevin Boos "] 3 | name = "pit_clock" 4 | description = "PIT (Programmable Interval Timer) support for Theseus, x86 only." 5 | version = "0.1.0" 6 | 7 | [dependencies] 8 | log = "0.4.8" 9 | x86_64 = "0.14.8" 10 | 11 | [dependencies.pit_clock_basic] 12 | path = "../pit_clock_basic" 13 | 14 | [dependencies.interrupts] 15 | path = "../interrupts" 16 | 17 | [dependencies.port_io] 18 | path = "../../libs/port_io" 19 | 20 | [lib] 21 | crate-type = ["rlib"] 22 | -------------------------------------------------------------------------------- /kernel/pit_clock_basic/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["Kevin Boos "] 3 | name = "pit_clock_basic" 4 | description = "Basic support for waiting using the PIT (Programmable Interval Timer)" 5 | version = "0.1.0" 6 | 7 | [dependencies] 8 | spin = "0.9.4" 9 | log = "0.4.8" 10 | 11 | [dependencies.port_io] 12 | path = "../../libs/port_io" 13 | 14 | [lib] 15 | crate-type = ["rlib"] 16 | -------------------------------------------------------------------------------- /kernel/preemption/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "preemption" 3 | version = "0.1.0" 4 | authors = ["Kevin Boos ", "Klim Tsoutsman "] 5 | description = "Handles enabling and disabling preemption for each CPU core" 6 | edition = "2021" 7 | 8 | [dependencies] 9 | cls_macros = { path = "../cls/cls_macros" } 10 | cpu = { path = "../cpu" } 11 | 12 | [target.'cfg(target_arch = "x86_64")'.dependencies] 13 | apic = { path = "../apic" } 14 | -------------------------------------------------------------------------------- /kernel/ps2/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "ps2" 3 | version = "0.1.0" 4 | description = "Drivers for the PS/2 interface, supporting legacy keyboard and mouse" 5 | authors = ["Bowen Liu , Hecatia Elegua"] 6 | edition = "2021" 7 | 8 | [dependencies] 9 | log = "0.4.8" 10 | spin = "0.9.4" 11 | modular-bitfield = "0.11.2" 12 | 13 | [dependencies.num_enum] 14 | version = "0.5.7" 15 | default-features = false 16 | 17 | [dependencies.port_io] 18 | path = "../../libs/port_io" 19 | 20 | [dependencies.acpi] 21 | path = "../acpi/" 22 | 23 | [dependencies.fadt] 24 | path = "../acpi/fadt" 25 | 26 | [lib] 27 | crate-type = ["rlib"] 28 | 29 | -------------------------------------------------------------------------------- /kernel/pte_flags/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "pte_flags" 3 | authors = ["Nathan Royer ", "Kevin Boos "] 5 | description = "A cryptograhically secure source of randomness" 6 | edition = "2021" 7 | 8 | [dependencies] 9 | lazy_static = "1.4.0" 10 | log = "0.4.8" 11 | spin = "0.9.4" 12 | tsc = { path = "../tsc" } 13 | 14 | [dependencies.rand_chacha] 15 | version = "0.3.0" 16 | default-features = false 17 | 18 | [dependencies.rdrand] 19 | version = "0.8.2" 20 | default-features = false 21 | -------------------------------------------------------------------------------- /kernel/rendezvous/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["Kevin Boos "] 3 | name = "rendezvous" 4 | description = "Synchronous Inter-Task Communication using a rendezvous approach" 5 | version = "0.1.0" 6 | 7 | [dependencies] 8 | spin = "0.9.4" 9 | 10 | [dependencies.log] 11 | version = "0.4.8" 12 | 13 | [dependencies.debugit] 14 | path = "../../libs/debugit" 15 | 16 | [dependencies.sync_irq] 17 | path = "../../libs/sync_irq" 18 | 19 | [dependencies.task] 20 | path = "../task" 21 | 22 | [dependencies.scheduler] 23 | path = "../scheduler" 24 | 25 | [dependencies.wait_queue] 26 | path = "../wait_queue" 27 | 28 | [dependencies.wait_guard] 29 | path = "../wait_guard" 30 | 31 | [dependencies.sync] 32 | path = "../../libs/sync" 33 | 34 | [dependencies.sync_spin] 35 | path = "../../libs/sync_spin" 36 | 37 | [lib] 38 | crate-type = ["rlib"] 39 | -------------------------------------------------------------------------------- /kernel/root/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "root" 3 | version = "0.1.0" 4 | authors = ["Andrew Pham "] 5 | description = "a special concrete implementation of the Directory trait; differs from VFSDirectory only in that there is no parent field, and any attempt to access a parent field will return some error value" 6 | 7 | [dependencies] 8 | spin = "0.9.4" 9 | 10 | [dependencies.lazy_static] 11 | features = ["spin_no_std"] 12 | version = "1.4.0" 13 | 14 | [dependencies.fs_node] 15 | path = "../fs_node" 16 | 17 | [dependencies.log] 18 | version = "0.4.8" 19 | 20 | 21 | [lib] 22 | crate-type = ["rlib"] 23 | -------------------------------------------------------------------------------- /kernel/rtc/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["Kevin Boos "] 3 | name = "rtc" 4 | description = "Support for the Real-time Clock chip on x86 processors" 5 | version = "0.1.0" 6 | 7 | [dependencies] 8 | spin = "0.9.4" 9 | x86_64 = "0.14.8" 10 | 11 | [dependencies.lazy_static] 12 | features = ["spin_no_std"] 13 | version = "1.4.0" 14 | 15 | [dependencies.log] 16 | version = "0.4.8" 17 | 18 | [dependencies.irq_safety] 19 | git = "https://github.com/theseus-os/irq_safety" 20 | 21 | [dependencies.port_io] 22 | path = "../../libs/port_io" 23 | version = "0.2.1" 24 | 25 | [dependencies.kernel_config] 26 | path = "../kernel_config" 27 | 28 | [dependencies.state_store] 29 | path = "../state_store" 30 | 31 | 32 | # [build] 33 | # rustflags = ["-C", "prefer-dynamic", "-C", "panic=abort"] 34 | 35 | 36 | [lib] 37 | crate-type = ["rlib"] 38 | -------------------------------------------------------------------------------- /kernel/scheduler/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["Kevin Boos "] 3 | name = "scheduler" 4 | description = "Provides basic scheduling functionality for preemptive task switching." 5 | version = "0.1.0" 6 | edition = "2018" 7 | 8 | [dependencies] 9 | log = "0.4.8" 10 | cfg-if = "1.0.0" 11 | 12 | cpu = { path = "../cpu" } 13 | interrupts = { path = "../interrupts" } 14 | sleep = { path = "../sleep" } 15 | task = { path = "../task" } 16 | 17 | [target.'cfg(target_arch = "x86_64")'.dependencies] 18 | x86_64 = "0.14.8" 19 | 20 | [target.'cfg(target_arch = "aarch64")'.dependencies] 21 | generic_timer_aarch64 = { path = "../generic_timer_aarch64" } 22 | kernel_config = { path = "../kernel_config" } 23 | spin = "0.9.4" 24 | -------------------------------------------------------------------------------- /kernel/scheduler_epoch/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["Namitha Liyanage "] 3 | name = "scheduler_epoch" 4 | description = "Provides epoch scheduling functionality and picks the next task" 5 | version = "0.1.0" 6 | edition = "2021" 7 | 8 | [dependencies] 9 | spin = "0.9.4" 10 | 11 | [dependencies.log] 12 | version = "0.4.8" 13 | 14 | [dependencies.task] 15 | path = "../task" 16 | 17 | [lib] 18 | crate-type = ["rlib"] 19 | -------------------------------------------------------------------------------- /kernel/scheduler_priority/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["Jacob Earle "] 3 | name = "scheduler_priority" 4 | description = "Provides a priority scheduler" 5 | version = "0.1.0" 6 | edition = "2021" 7 | 8 | [dependencies] 9 | log = "0.4.8" 10 | task = { path = "../task" } 11 | time = { path = "../time" } 12 | 13 | [lib] 14 | crate-type = ["rlib"] 15 | -------------------------------------------------------------------------------- /kernel/scheduler_round_robin/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["Kevin Boos "] 3 | name = "scheduler_round_robin" 4 | description = "Provides Round robin scheduling functionality and picks the next task" 5 | version = "0.1.0" 6 | edition = "2021" 7 | 8 | [dependencies] 9 | log = "0.4.8" 10 | spin = "0.9.4" 11 | task = { path = "../task" } 12 | 13 | [lib] 14 | crate-type = ["rlib"] 15 | -------------------------------------------------------------------------------- /kernel/serial_port/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["Kevin Boos "] 3 | name = "serial_port" 4 | description = "Advanced support for serial ports (e.g., COM1, COM2) with full interrupt support" 5 | version = "0.1.0" 6 | edition = "2021" 7 | 8 | [dependencies] 9 | log = "0.4.8" 10 | spin = "0.9.4" 11 | core2 = { version = "0.4.0", default-features = false, features = ["alloc", "nightly"] } 12 | 13 | serial_port_basic = { path = "../serial_port_basic" } 14 | sync_irq = { path = "../../libs/sync_irq" } 15 | interrupts = { path = "../interrupts" } 16 | deferred_interrupt_tasks = { path = "../deferred_interrupt_tasks" } 17 | 18 | # Dependencies below here are temporary, for console creation testing. 19 | sync_channel = { path = "../sync_channel" } 20 | 21 | [lib] 22 | crate-type = ["rlib"] 23 | -------------------------------------------------------------------------------- /kernel/serial_port_basic/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["Kevin Boos "] 3 | name = "serial_port_basic" 4 | description = "Standalone, basic driver for serial ports (e.g., COM1, COM) with minimal dependencies" 5 | edition = "2021" 6 | version = "0.1.0" 7 | 8 | [dependencies] 9 | sync_irq = { path = "../../libs/sync_irq" } 10 | spin = "0.9.4" 11 | 12 | [target.'cfg(target_arch = "x86_64")'.dependencies] 13 | port_io = { path = "../../libs/port_io" } 14 | 15 | [target.'cfg(target_arch = "aarch64")'.dependencies] 16 | uart_pl011 = { path = "../uart_pl011" } 17 | arm_boards = { path = "../arm_boards" } 18 | 19 | [lib] 20 | crate-type = ["rlib"] 21 | -------------------------------------------------------------------------------- /kernel/shapes/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "shapes" 3 | version = "0.1.0" 4 | authors = ["Wenqiu Yu "] 5 | description = "define the basic shapes used in display subsystem" 6 | 7 | [dependencies] 8 | 9 | [lib] 10 | crate-type = ["rlib"] 11 | -------------------------------------------------------------------------------- /kernel/signal_handler/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["Kevin Boos "] 3 | name = "signal_handler" 4 | description = "Support for registering POSIX-style signal handlers or trap handlers" 5 | version = "0.1.0" 6 | edition = "2021" 7 | 8 | [dependencies] 9 | x86_64 = "0.14.8" 10 | log = "0.4.8" 11 | spin = "0.9.4" 12 | 13 | memory = { path = "../memory" } 14 | task = { path = "../task" } 15 | thread_local_macro = { path = "../thread_local_macro" } 16 | -------------------------------------------------------------------------------- /kernel/simd_personality/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["Kevin Boos "] 3 | name = "simd_personality" 4 | description = "Support for multiple kernel personalities: SIMD and non-SIMD" 5 | version = "0.1.0" 6 | 7 | [dependencies] 8 | cfg-if = "0.1.6" 9 | 10 | [dependencies.pit_clock] 11 | path = "../pit_clock" 12 | 13 | [dependencies.log] 14 | version = "0.4.8" 15 | 16 | [dependencies.memory] 17 | path = "../memory" 18 | 19 | [dependencies.task] 20 | path = "../task" 21 | 22 | [dependencies.spawn] 23 | path = "../spawn" 24 | 25 | [dependencies.cpu] 26 | path = "../cpu" 27 | 28 | [dependencies.mod_mgmt] 29 | path = "../mod_mgmt" 30 | 31 | [dependencies.fs_node] 32 | path = "../fs_node" 33 | 34 | # [target.'cfg(target_feature = "sse2")'.dependencies.compiler_builtins] 35 | # git = "https://github.com/rust-lang-nursery/compiler-builtins" 36 | # features = [ "no-lang-items" ] 37 | 38 | [lib] 39 | crate-type = ["rlib"] 40 | -------------------------------------------------------------------------------- /kernel/simd_test/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["Kevin Boos "] 3 | name = "simd_test" 4 | description = "Test code for SIMD instructions" 5 | version = "0.1.0" 6 | 7 | [dependencies] 8 | cfg-if = "0.1.6" 9 | log = "0.4.8" 10 | 11 | ## Only include the SIMD crates when any SIMD extensions are enabled 12 | [target.'cfg(target_feature = "sse2")'.dependencies.core_simd] 13 | git = "https://github.com/rust-lang/stdsimd" 14 | 15 | 16 | [lib] 17 | crate-type = ["rlib"] 18 | -------------------------------------------------------------------------------- /kernel/simple_ipc/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["Ramla Ijaz "] 3 | name = "simple_ipc" 4 | description = "An extremely basic mechanism for IPC that uses a lock-free shared buffer" 5 | version = "0.1.0" 6 | 7 | [dependencies] 8 | bit_field = "0.7.0" 9 | 10 | [dependencies.log] 11 | version = "0.4.8" 12 | 13 | 14 | [lib] 15 | crate-type = ["rlib"] 16 | -------------------------------------------------------------------------------- /kernel/single_simd_task_optimization/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["Kevin Boos "] 3 | name = "single_simd_task_optimization" 4 | description = "Support for a special optimization that allows a SIMD task to avoid saving SIMD registers when context switching, if it is the only SIMD task on its core" 5 | version = "0.1.0" 6 | 7 | [dependencies] 8 | cfg-if = "0.1.6" 9 | 10 | [dependencies.log] 11 | version = "0.4.8" 12 | 13 | [dependencies.task] 14 | path = "../task" 15 | 16 | 17 | [lib] 18 | crate-type = ["rlib"] 19 | -------------------------------------------------------------------------------- /kernel/slabmalloc/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "slabmalloc" 3 | version = "0.7.0" 4 | authors = ["Gerd Zellweger ", "Ramla Ijaz "] 5 | description = "Simple slab based malloc implementation in rust. Edited to work more closely with Theseus's memory management abstractions" 6 | 7 | keywords = ["os", "malloc", "slab", "alloc", "memory"] 8 | 9 | [features] 10 | unstable = [] 11 | default = [ "unstable" ] 12 | 13 | [dependencies.log] 14 | version = "0.4.8" 15 | 16 | [dependencies.memory] 17 | path = "../../kernel/memory" 18 | 19 | -------------------------------------------------------------------------------- /kernel/slabmalloc_safe/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "slabmalloc_safe" 3 | version = "0.7.0" 4 | authors = ["Ramla Ijaz "] 5 | description = "Simple slab based malloc implementation in rust. A version of the slabmalloc crate that uses only safe features" 6 | homepage = "https://github.com/gz/rust-slabmalloc" 7 | license = "MIT" 8 | 9 | keywords = ["os", "malloc", "slab", "alloc", "memory"] 10 | 11 | [features] 12 | unstable = [] 13 | default = [ "unstable" ] 14 | 15 | [dependencies.log] 16 | version = "0.4.8" 17 | 18 | [dependencies.memory] 19 | path = "../memory" 20 | 21 | -------------------------------------------------------------------------------- /kernel/slabmalloc_unsafe/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "slabmalloc_unsafe" 3 | version = "0.7.0" 4 | authors = ["Gerd Zellweger ", "Ramla Ijaz "] 5 | description = "Simple slab based malloc implementation in rust" 6 | 7 | keywords = ["os", "malloc", "slab", "alloc", "memory"] 8 | 9 | [features] 10 | unstable = [] 11 | default = [ "unstable" ] 12 | 13 | [dependencies.log] 14 | version = "0.4.8" 15 | 16 | 17 | -------------------------------------------------------------------------------- /kernel/sleep/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["Jacob Earle "] 3 | name = "sleep" 4 | description = "Provides APIs that allow tasks to be delayed for specified intervals of time" 5 | version = "0.1.0" 6 | 7 | [dependencies] 8 | 9 | [dependencies.lazy_static] 10 | features = ["spin_no_std"] 11 | version = "1.2.0" 12 | 13 | [dependencies.task] 14 | path = "../task" 15 | 16 | [dependencies.sync_irq] 17 | path = "../../libs/sync_irq" 18 | 19 | [dependencies.time] 20 | path = "../time" 21 | 22 | [dependencies.crossbeam-utils] 23 | version = "0.8.12" 24 | default-features = false 25 | 26 | [lib] 27 | crate-type = ["rlib"] 28 | -------------------------------------------------------------------------------- /kernel/stack/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["Kevin Boos "] 3 | name = "stack" 4 | description = "Defines the Stack type (a task's stack memory) and functions to allocate them" 5 | version = "0.1.0" 6 | 7 | [dependencies] 8 | spin = "0.9.4" 9 | 10 | [dependencies.log] 11 | version = "0.4.8" 12 | 13 | [dependencies.kernel_config] 14 | path = "../kernel_config" 15 | 16 | [dependencies.memory_structs] 17 | path = "../memory_structs" 18 | 19 | [dependencies.page_allocator] 20 | path = "../page_allocator" 21 | 22 | [dependencies.memory] 23 | path = "../memory" 24 | 25 | [lib] 26 | crate-type = ["rlib"] 27 | -------------------------------------------------------------------------------- /kernel/stack_trace/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["Kevin Boos "] 3 | name = "stack_trace" 4 | description = "The default stack trace (backtrace) functionality, which uses DWARF debugging info" 5 | version = "0.1.0" 6 | 7 | [dependencies] 8 | fallible-iterator = { version = "0.2.0", default-features = false } 9 | 10 | [dependencies.log] 11 | version = "0.4.8" 12 | 13 | [dependencies.mod_mgmt] 14 | path = "../mod_mgmt" 15 | 16 | [dependencies.task] 17 | path = "../task" 18 | 19 | [dependencies.unwind] 20 | path = "../unwind" 21 | 22 | 23 | [lib] 24 | crate-type = ["rlib"] 25 | -------------------------------------------------------------------------------- /kernel/stack_trace_frame_pointers/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["Kevin Boos "] 3 | name = "stack_trace_frame_pointers" 4 | description = "Stack trace (backtrace) functionality using frame pointers (non-default choice)" 5 | version = "0.1.0" 6 | build = "build.rs" 7 | 8 | [dependencies] 9 | cfg-if = "0.1.6" 10 | 11 | [dependencies.memory] 12 | path = "../memory" 13 | 14 | [lib] 15 | crate-type = ["rlib"] 16 | -------------------------------------------------------------------------------- /kernel/stack_trace_frame_pointers/build.rs: -------------------------------------------------------------------------------- 1 | //! This build script is used to enable the `frame_pointers` cfg option 2 | //! if the corresponding rustflags value is set. 3 | 4 | /// The prefix that must come before each custom cfg option. 5 | const CFG_PREFIX: &str = "cargo:rustc-cfg="; 6 | 7 | 8 | fn main() { 9 | println!("cargo:rerun-if-env-changed=THESEUS_CONFIG"); 10 | println!("cargo:rerun-if-env-changed=CARGO_ENCODED_RUSTFLAGS"); 11 | 12 | // Since there is no known way to obtain cfg values for codegen options, 13 | // we must set the cfg value for force-frame-pointers. 14 | if let Ok(rustflags) = std::env::var("CARGO_ENCODED_RUSTFLAGS") { 15 | if rustflags.contains("force-frame-pointers=yes") 16 | || rustflags.contains("force-frame-pointers=true") { 17 | println!("{CFG_PREFIX}frame pointers"); 18 | } 19 | } else { 20 | eprintln!("Note: CARGO_ENCODED_RUSTFLAGS env var did not exist."); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /kernel/state_store/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["Kevin Boos "] 3 | name = "state_store" 4 | description = "Database-like storage for static, system-wide states, which allows other crates to remain stateless" 5 | version = "0.1.0" 6 | 7 | [dependencies] 8 | # typemap = "0.3.3" 9 | spin = "0.9.4" 10 | 11 | [dependencies.lazy_static] 12 | features = ["spin_no_std"] 13 | version = "1.4.0" 14 | 15 | [dependencies.atomic_linked_list] 16 | path = "../../libs/atomic_linked_list" 17 | 18 | 19 | # [build] 20 | # rustflags = ["-C", "prefer-dynamic", "-C", "panic=abort"] 21 | 22 | # [bin] 23 | 24 | [lib] 25 | crate-type = ["rlib"] 26 | -------------------------------------------------------------------------------- /kernel/storage_device/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["Kevin Boos "] 3 | name = "storage_device" 4 | description = "Traits for storage devices and storage controllers" 5 | version = "0.1.0" 6 | 7 | [dependencies] 8 | spin = "0.9.4" 9 | downcast-rs = { version = "1.2.0", default-features = false } 10 | 11 | [dependencies.log] 12 | version = "0.4.8" 13 | 14 | [dependencies.lazy_static] 15 | features = ["spin_no_std"] 16 | version = "1.4.0" 17 | 18 | [dependencies.io] 19 | path = "../io" 20 | 21 | [lib] 22 | crate-type = ["rlib"] 23 | -------------------------------------------------------------------------------- /kernel/storage_manager/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["Kevin Boos "] 3 | name = "storage_manager" 4 | description = "A crate for managing storage devices/drives" 5 | version = "0.1.0" 6 | 7 | [dependencies] 8 | spin = "0.9.4" 9 | log = "0.4.8" 10 | 11 | [dependencies.storage_device] 12 | path = "../storage_device" 13 | 14 | [dependencies.pci] 15 | path = "../pci" 16 | 17 | [dependencies.ata] 18 | path = "../ata" 19 | 20 | [lib] 21 | crate-type = ["rlib"] 22 | -------------------------------------------------------------------------------- /kernel/sync_block/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "sync_block" 3 | version = "0.1.0" 4 | description = "Blocking synchronisation primitives" 5 | edition = "2021" 6 | 7 | [dependencies] 8 | preemption = { path = "../preemption" } 9 | mpmc_queue = { path = "../../libs/mpmc_queue" } 10 | log = "0.4.8" 11 | scheduler = { path = "../scheduler" } 12 | sync = { path = "../../libs/sync" } 13 | task = { path = "../task" } 14 | sync_spin = { path = "../../libs/sync_spin" } 15 | wait_queue = { path = "../wait_queue" } 16 | 17 | [features] 18 | std-api = [] 19 | -------------------------------------------------------------------------------- /kernel/sync_channel/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["Kevin Boos "] 3 | name = "sync_channel" 4 | description = "Channel for asynchronous Inter-Task Communication via a bounded buffer" 5 | version = "0.1.0" 6 | 7 | [dependencies] 8 | crossbeam-utils = { version = "0.8.12", default-features = false } 9 | mpmc = "0.1.6" 10 | 11 | [dependencies.log] 12 | version = "0.4.8" 13 | 14 | [dependencies.debugit] 15 | path = "../../libs/debugit" 16 | 17 | [dependencies.wait_queue] 18 | path = "../wait_queue" 19 | 20 | [dependencies.sync] 21 | path = "../../libs/sync" 22 | 23 | [dependencies.sync_spin] 24 | path = "../../libs/sync_spin" 25 | 26 | [dependencies.core2] 27 | version = "0.4.0" 28 | default-features = false 29 | features = ["alloc", "nightly"] 30 | 31 | [lib] 32 | crate-type = ["rlib"] 33 | -------------------------------------------------------------------------------- /kernel/sync_preemption/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "sync_preemption" 3 | version = "0.1.0" 4 | description = "Preemption-disabling synchronisation primitives" 5 | edition = "2021" 6 | 7 | [dependencies] 8 | preemption = { path = "../preemption" } 9 | sync = { path = "../../libs/sync" } 10 | -------------------------------------------------------------------------------- /kernel/task/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["Kevin Boos "] 3 | name = "task" 4 | description = "Shareable Task reference with more robust multithreading functionality" 5 | version = "0.1.0" 6 | edition = "2021" 7 | 8 | [dependencies] 9 | log = "0.4.8" 10 | spin = "0.9.4" 11 | static_assertions = "1.1.0" 12 | crossbeam-utils = { version = "0.8.2", default-features = false } 13 | 14 | irq_safety = { git = "https://github.com/theseus-os/irq_safety" } 15 | 16 | context_switch = { path = "../context_switch" } 17 | cls = { path = "../cls" } 18 | cpu = { path = "../cpu" } 19 | environment = { path = "../environment" } 20 | memory = { path = "../memory" } 21 | mod_mgmt = { path = "../mod_mgmt" } 22 | no_drop = { path = "../no_drop" } 23 | preemption = { path = "../preemption" } 24 | stack = { path = "../stack" } 25 | sync_irq = { path = "../../libs/sync_irq" } 26 | sync_preemption = { path = "../sync_preemption" } 27 | task_struct = { path = "../task_struct" } 28 | waker_generic = { path = "../waker_generic" } 29 | -------------------------------------------------------------------------------- /kernel/task_fs/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "task_fs" 3 | version = "0.1.0" 4 | authors = ["Andrew Pham , Christine Wang "] 3 | name = "task_struct" 4 | description = "Basic task struct definition for multithreading" 5 | version = "0.1.0" 6 | edition = "2021" 7 | 8 | [dependencies] 9 | crossbeam-utils = { version = "0.8.12", default-features = false } 10 | log = "0.4.8" 11 | spin = "0.9.4" 12 | 13 | cpu = { path = "../cpu" } 14 | environment = { path = "../environment" } 15 | kernel_config = { path = "../kernel_config" } 16 | memory = { path = "../memory" } 17 | mod_mgmt = { path = "../mod_mgmt" } 18 | stack = { path = "../stack" } 19 | sync_irq = { path = "../../libs/sync_irq" } 20 | -------------------------------------------------------------------------------- /kernel/test_thread_local/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["Kevin Boos "] 3 | name = "test_thread_local" 4 | description = "Test cases for thread-local storage (TLS) directly using the #[thread_local] attribute" 5 | version = "0.1.0" 6 | 7 | [dependencies.log] 8 | version = "0.4.8" 9 | 10 | [dependencies.task] 11 | path = "../../kernel/task" 12 | 13 | [dependencies.spawn] 14 | path = "../../kernel/spawn" 15 | 16 | [lib] 17 | crate-type = ["rlib"] 18 | -------------------------------------------------------------------------------- /kernel/text_terminal/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "text_terminal" 3 | version = "0.1.0" 4 | authors = ["Kevin Boos "] 5 | description = "A text-based terminal emulator that supports ANSI, VT100, xterm, and other standards." 6 | 7 | [dependencies] 8 | bitflags = "2.4.1" 9 | core2 = { version = "0.4.0", default-features = false, features = ["alloc", "nightly"] } 10 | unicode-width = "0.1.8" 11 | vte = "0.10.1" 12 | derive_more = "0.99.0" 13 | 14 | [dependencies.log] 15 | version = "0.4.8" 16 | 17 | [dependencies.event_types] 18 | path = "../event_types" 19 | 20 | [lib] 21 | crate-type = ["rlib"] 22 | -------------------------------------------------------------------------------- /kernel/thread_local_macro/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["Kevin Boos "] 3 | name = "thread_local_macro" 4 | description = "Implementation of the thread_local!() macro, similar to Rust libstd" 5 | version = "0.1.0" 6 | 7 | [dependencies] 8 | 9 | [lib] 10 | crate-type = ["rlib"] 11 | -------------------------------------------------------------------------------- /kernel/time/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "time" 3 | version = "0.1.0" 4 | authors = ["Klim Tsoutsman "] 5 | description = "Abstraction for hardware clocks" 6 | edition = "2021" 7 | 8 | [dependencies] 9 | log = "0.4.8" 10 | 11 | [dependencies.crossbeam-utils] 12 | version = "0.8.2" 13 | default-features = false 14 | -------------------------------------------------------------------------------- /kernel/time/src/dummy.rs: -------------------------------------------------------------------------------- 1 | use crate::Instant; 2 | use core::time::Duration; 3 | use log::error; 4 | 5 | type _AtomicFn = crossbeam_utils::atomic::AtomicCell; 6 | const _: () = assert!(_AtomicFn::is_lock_free()); 7 | const _: () = assert!(core::mem::size_of::<_AtomicFn>() == 8); 8 | 9 | pub(crate) fn early_sleep(_: Duration) { 10 | error!("called early_sleep dummy function"); 11 | } 12 | 13 | pub(crate) fn monotonic_now() -> Instant { 14 | error!("called monotonic_now dummy function"); 15 | Instant::ZERO 16 | } 17 | 18 | pub(crate) fn wall_time_now() -> Duration { 19 | error!("called wall_time_now dummy function"); 20 | Duration::ZERO 21 | } 22 | -------------------------------------------------------------------------------- /kernel/tlb_shootdown/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["Kevin Boos "] 3 | name = "tlb_shootdown" 4 | description = "Routines for handling TLB shootdowns" 5 | version = "0.1.0" 6 | edition = "2021" 7 | 8 | [dependencies] 9 | log = "0.4.8" 10 | irq_safety = { git = "https://github.com/theseus-os/irq_safety" } 11 | memory = { path = "../memory" } 12 | cpu = { path = "../cpu" } 13 | sync_irq = { path = "../../libs/sync_irq" } 14 | 15 | [target.'cfg(target_arch = "x86_64")'.dependencies] 16 | memory_x86_64 = { path = "../memory_x86_64" } 17 | apic = { path = "../apic" } 18 | 19 | [target.'cfg(target_arch = "aarch64")'.dependencies] 20 | memory_aarch64 = { path = "../memory_aarch64" } 21 | interrupts = { path = "../interrupts" } 22 | -------------------------------------------------------------------------------- /kernel/tsc/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["Kevin Boos "] 3 | name = "tsc" 4 | description = "TSC (TimeStamp Counter) support for performance counters on x86. Basically a wrapper around rdtsc." 5 | version = "0.1.0" 6 | edition = "2021" 7 | 8 | [dependencies] 9 | log = "0.4.8" 10 | pit_clock_basic = { path = "../pit_clock_basic" } 11 | time = { path = "../time" } 12 | 13 | -------------------------------------------------------------------------------- /kernel/tss/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["Kevin Boos "] 3 | name = "tss" 4 | description = "TSS (Task State Segment support (x86 only) for Theseus" 5 | version = "0.1.0" 6 | edition = "2021" 7 | 8 | [dependencies] 9 | log = "0.4.8" 10 | spin = "0.9.4" 11 | x86_64 = "0.14.8" 12 | 13 | [dependencies.atomic_linked_list] 14 | path = "../../libs/atomic_linked_list" 15 | 16 | [dependencies.memory] 17 | path = "../memory" 18 | 19 | [dependencies.cpu] 20 | path = "../cpu" 21 | 22 | 23 | [lib] 24 | crate-type = ["rlib"] 25 | -------------------------------------------------------------------------------- /kernel/tty/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "tty" 3 | version = "0.1.0" 4 | authors = ["Klim Tsoutsman "] 5 | description = "TTY abstractions" 6 | edition = "2021" 7 | 8 | [dependencies] 9 | sync_channel = { path = "../sync_channel" } 10 | sync_block = { path = "../sync_block" } 11 | 12 | [dependencies.core2] 13 | version = "0.4.0" 14 | default-features = false 15 | features = ["alloc", "nightly"] 16 | -------------------------------------------------------------------------------- /kernel/uart_pl011/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "uart_pl011" 3 | authors = ["Nathan Royer "] 4 | description = "Simple Driver for PL011 UARTs" 5 | version = "0.1.0" 6 | edition = "2021" 7 | 8 | [dependencies] 9 | log = "0.4.8" 10 | volatile = "0.2.7" 11 | zerocopy = "0.5.0" 12 | memory = { path = "../memory" } -------------------------------------------------------------------------------- /kernel/unified_channel/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "unified_channel" 3 | version = "0.1.0" 4 | description = "A cfg-based wrapper that unifies rendezvous channels and async channels, for evaluation purposes" 5 | authors = ["Kevin Boos "] 6 | 7 | [dependencies] 8 | cfg-if = "0.1.6" 9 | 10 | [dependencies.sync_channel] 11 | path = "../sync_channel" 12 | 13 | [dependencies.rendezvous] 14 | path = "../rendezvous" 15 | -------------------------------------------------------------------------------- /kernel/unwind/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["Kevin Boos "] 3 | name = "unwind" 4 | description = "Routines for unwinding the call stack and running cleanup handlers for Theseus tasks" 5 | version = "0.1.0" 6 | 7 | [dependencies] 8 | fallible-iterator = { version = "0.2.0", default-features = false } 9 | 10 | [dependencies.gimli] 11 | version = "0.25.0" 12 | default-features = false 13 | features = [ "read" ] 14 | 15 | [dependencies.log] 16 | version = "0.4.8" 17 | 18 | [dependencies.memory] 19 | path = "../memory" 20 | 21 | [dependencies.mod_mgmt] 22 | path = "../mod_mgmt" 23 | 24 | [dependencies.task] 25 | path = "../task" 26 | 27 | [dependencies.interrupts] 28 | path = "../interrupts" 29 | 30 | [dependencies.external_unwind_info] 31 | path = "../external_unwind_info" 32 | 33 | [lib] 34 | crate-type = ["rlib"] 35 | -------------------------------------------------------------------------------- /kernel/vfs_node/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "vfs_node" 3 | version = "0.1.0" 4 | authors = ["Andrew Pham , Christine Wang "] 3 | name = "vga_buffer" 4 | description = "Support for printing to an 80x25 text-mode VGA display" 5 | version = "0.1.0" 6 | edition = "2021" 7 | 8 | [dependencies] 9 | volatile = "0.2.7" 10 | -------------------------------------------------------------------------------- /kernel/virtual_nic/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["Ramla Ijaz "] 3 | name = "virtual_nic" 4 | description = "A structure that contains a subset of physical NIC resources that are sufficient to send/receive packets without kernel mediation." 5 | version = "0.1.0" 6 | 7 | [dependencies] 8 | 9 | [dependencies.nic_buffers] 10 | path = "../nic_buffers" 11 | 12 | [dependencies.nic_queues] 13 | path = "../nic_queues" 14 | 15 | [dependencies.net] 16 | path = "../net" 17 | 18 | [dependencies.physical_nic] 19 | path = "../physical_nic" 20 | 21 | [dependencies.intel_ethernet] 22 | path = "../intel_ethernet" 23 | 24 | [dependencies.sync_irq] 25 | path = "../../libs/sync_irq" 26 | 27 | [lib] 28 | crate-type = ["rlib"] 29 | -------------------------------------------------------------------------------- /kernel/wait_condition/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["Kevin Boos "] 3 | name = "wait_condition" 4 | description = "Wait condition variables that can block/sleep and wake up tasks" 5 | version = "0.1.0" 6 | 7 | [dependencies.wait_queue] 8 | path = "../wait_queue" 9 | 10 | [lib] 11 | crate-type = ["rlib"] 12 | -------------------------------------------------------------------------------- /kernel/wait_guard/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "wait_guard" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | task = { path = "../task" } 8 | -------------------------------------------------------------------------------- /kernel/wait_queue/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["Kevin Boos "] 3 | name = "wait_queue" 4 | description = "The WaitQueue type that can block/sleep and wake up tasks" 5 | version = "0.1.0" 6 | edition = "2021" 7 | 8 | [dependencies] 9 | mpmc_queue = { path = "../../libs/mpmc_queue" } 10 | preemption = { path = "../preemption" } 11 | scheduler = { path = "../scheduler" } 12 | sync = { path = "../../libs/sync" } 13 | sync_spin = { path = "../../libs/sync_spin" } 14 | task = { path = "../task" } 15 | -------------------------------------------------------------------------------- /kernel/waker/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "waker" 3 | version = "0.1.0" 4 | authors = ["Kevin Boos ", "Klim Tsoutsman "] 5 | description = "A standard Waker + Blocker implementation that directly uses task blocking" 6 | edition = "2021" 7 | 8 | [dependencies] 9 | spin = "0.9.4" 10 | 11 | task = { path = "../task" } 12 | waker_generic = { path = "../waker_generic" } 13 | -------------------------------------------------------------------------------- /kernel/waker_generic/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "waker_generic" 3 | version = "0.1.0" 4 | authors = ["Kevin Boos ", "Klim Tsoutsman "] 5 | description = "A standalone generic Waker + Blocker implementation, with no dependency on tasking" 6 | edition = "2021" 7 | 8 | [dependencies] 9 | spin = "0.9.4" 10 | preemption = { path = "../preemption" } 11 | -------------------------------------------------------------------------------- /kernel/wasi_interpreter/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "wasi_interpreter" 3 | version = "0.1.0" 4 | authors = ["Vikram Mullick "] 5 | edition = "2018" 6 | description = "Interpreter for executing WASI-compliant WASM binaries" 7 | 8 | [dependencies] 9 | core2 = { version = "0.4.0", default-features = false, features = ["alloc", "nightly"] } 10 | hashbrown = { version = "0.11.2", features = ["nightly"] } 11 | wasi = { git = "https://github.com/bytecodealliance/wasi", rev = "45536ac956a6211e3cff047f36cf19d6da82fd95", default-features = false } 12 | wasmi = { version = "0.9.0", default-features = false, features = ["core"] } 13 | 14 | [dependencies.app_io] 15 | path = "../../kernel/app_io" 16 | 17 | [dependencies.fs_node] 18 | path = "../../kernel/fs_node" 19 | 20 | [dependencies.memfs] 21 | path = "../../kernel/memfs" 22 | 23 | [dependencies.path] 24 | path = "../../kernel/path" 25 | 26 | [dependencies.root] 27 | path = "../../kernel/root" 28 | 29 | [dependencies.task] 30 | path = "../../kernel/task" 31 | -------------------------------------------------------------------------------- /kernel/window_inner/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "window_inner" 3 | version = "0.1.0" 4 | authors = ["Yue Wu ", "Wenqiu Yu "] 5 | description = "allocate new windows and manage a list of existing windows" 6 | 7 | [dependencies] 8 | mpmc = "0.1.6" 9 | 10 | [dependencies.framebuffer] 11 | path = "../framebuffer" 12 | 13 | [dependencies.shapes] 14 | path = "../shapes" 15 | 16 | [dependencies.event_types] 17 | path = "../event_types" 18 | 19 | [lib] 20 | crate-type = ["rlib"] 21 | -------------------------------------------------------------------------------- /libs/README.md: -------------------------------------------------------------------------------- 1 | # `libs/`: Third-party Libraries 2 | 3 | This directory contains libraries that are used in and/or customized by Theseus but are considered "third-party". 4 | The general idea is that these libraries are not Theseus-specific and could be refactored out into their own standalone projects easily. 5 | 6 | As such, and most importantly, libraries in `libs/` **must not depend** on any crates in the Theseus kernel (in `kernel/`). 7 | 8 | Some of these folders are git submodules (separate repositories), while others are included directly in the main Theseus repository itself. 9 | 10 | -------------------------------------------------------------------------------- /libs/atomic_linked_list/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["Kevin Boos "] 3 | name = "atomic_linked_list" 4 | version = "0.1.0" 5 | 6 | [dependencies] 7 | # debugit = "0.1.2" 8 | 9 | # [build] 10 | # rustflags = ["-C", "prefer-dynamic", "-C", "panic=abort"] 11 | 12 | # [bin] 13 | 14 | [lib] 15 | crate-type = ["rlib"] -------------------------------------------------------------------------------- /libs/atomic_linked_list/src/lib.rs: -------------------------------------------------------------------------------- 1 | #![no_std] 2 | #![feature(stmt_expr_attributes)] 3 | 4 | #[cfg(test)] 5 | #[macro_use] extern crate std; 6 | 7 | extern crate alloc; 8 | 9 | /// A basic atomic linked list. 10 | pub mod atomic_linked_list; 11 | 12 | /// A basic map structure which is backed by an atomic linked list. 13 | pub mod atomic_map; 14 | -------------------------------------------------------------------------------- /libs/cow_arc/.gitignore: -------------------------------------------------------------------------------- 1 | # Generated by Cargo 2 | /target/ 3 | -------------------------------------------------------------------------------- /libs/cow_arc/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["Kevin Boos "] 3 | name = "cow_arc" 4 | version = "0.1.0" 5 | keywords = ["copy-on-write", "clone-on-write", "cow", "arc", "mrsw", "shared", "exclusive"] 6 | categories = ["no-std", "memory-management"] 7 | license = "MIT" 8 | 9 | [dependencies] 10 | spin = "0.9.4" 11 | dereffer = { path = "../dereffer" } 12 | -------------------------------------------------------------------------------- /libs/debugit/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["Kevin Boos "] 3 | name = "debugit" 4 | description = "A port of the debugit crate to no_std environments" 5 | version = "0.1.0" 6 | 7 | [lib] 8 | crate-type = ["rlib"] 9 | -------------------------------------------------------------------------------- /libs/dereffer/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["Kevin Boos "] 3 | name = "dereffer" 4 | description = "Type wrappers for deref-ing the inner value in arbitrary ways" 5 | version = "0.1.0" 6 | -------------------------------------------------------------------------------- /libs/keycodes_ascii/.gitignore: -------------------------------------------------------------------------------- 1 | # Generated by Cargo 2 | /target/ 3 | -------------------------------------------------------------------------------- /libs/keycodes_ascii/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["Kevin Boos , Hecatia Elegua"] 3 | name = "keycodes_ascii" 4 | version = "0.1.0" 5 | keywords = ["keyboard", "ascii", "ps2", "scan codes", "scancode"] 6 | categories = ["no-std", "hardware-support"] 7 | license = "MIT" 8 | edition = "2021" 9 | 10 | [dependencies] 11 | bitflags = "2.4.1" 12 | 13 | [dependencies.num_enum] 14 | version = "0.5.7" 15 | default-features = false 16 | -------------------------------------------------------------------------------- /libs/lockable/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["Kevin Boos "] 3 | name = "lockable" 4 | version = "0.1.0" 5 | keywords = ["lock", "mutex", "no_std", "locking"] 6 | description = "A trait that represents any lockable type, like Mutex or RwLock" 7 | categories = ["no-std", "concurrency"] 8 | license = "MIT" 9 | 10 | [dependencies] 11 | spin = "0.9.4" 12 | sync_irq = { path = "../../libs/sync_irq" } 13 | -------------------------------------------------------------------------------- /libs/locked_idt/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["Kevin Boos "] 3 | name = "locked_idt" 4 | description = "A struct that wraps an x86_64 IDT (Interrupt Descriptor Table) in an interrupt-safe mutex lock" 5 | version = "0.1.0" 6 | edition = "2018" 7 | 8 | [dependencies] 9 | sync_irq = { path = "../../libs/sync_irq" } 10 | x86_64 = "0.14.8" 11 | -------------------------------------------------------------------------------- /libs/mouse_data/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["Bowen Liu , Hecatia Elegua"] 3 | name = "mouse_data" 4 | version = "0.1.0" 5 | keywords = ["mouse"] 6 | categories = ["no-std", "hardware-support"] 7 | edition = "2021" 8 | 9 | [dependencies] 10 | modular-bitfield = "0.11.2" 11 | -------------------------------------------------------------------------------- /libs/mpmc_queue/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "mpmc_queue" 3 | version = "0.1.0" 4 | authors = ["Klim Tsoutsman "] 5 | description = "A growable FIFO MPMC queue" 6 | edition = "2021" 7 | 8 | [dependencies] 9 | sync = { path = "../sync" } 10 | 11 | [dev-dependencies] 12 | sync_spin = { path = "../sync_spin"} 13 | -------------------------------------------------------------------------------- /libs/msr/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["Kevin Boos "] 3 | name = "msr" 4 | description = "Definitions for Model-Specific Registers (MSR) for x86" 5 | version = "0.1.0" 6 | 7 | -------------------------------------------------------------------------------- /libs/owned_borrowed_trait/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["Kevin Boos "] 3 | name = "owned_borrowed_trait" 4 | description = """ 5 | An abstraction over an owned value or borrowed reference 6 | based on traits and marker types instead of enums. 7 | """ 8 | version = "0.1.0" 9 | -------------------------------------------------------------------------------- /libs/percent_encoding/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "percent-encoding" 3 | version = "1.0.2" 4 | authors = ["The rust-url developers"] 5 | description = "Percent encoding and decoding" 6 | repository = "https://github.com/servo/rust-url/" 7 | license = "MIT/Apache-2.0" 8 | 9 | [lib] 10 | doctest = false 11 | test = false 12 | path = "lib.rs" 13 | -------------------------------------------------------------------------------- /libs/percent_encoding/LICENSE-APACHE: -------------------------------------------------------------------------------- 1 | ../LICENSE-APACHE -------------------------------------------------------------------------------- /libs/percent_encoding/LICENSE-MIT: -------------------------------------------------------------------------------- 1 | ../LICENSE-MIT -------------------------------------------------------------------------------- /libs/port_io/.gitignore: -------------------------------------------------------------------------------- 1 | # Generated by Cargo 2 | /target/ 3 | -------------------------------------------------------------------------------- /libs/port_io/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "port_io" 3 | version = "0.2.1" 4 | authors = ["Kevin Boos ", "Eric Kidd "] 5 | edition = "2018" 6 | description = "Bare metal (no_std) inb, outb, inw, outw, inl, outw instructions with Rust-like API" 7 | homepage = "https://github.com/emk/toyos.rs/tree/master/crates/cpuio" 8 | repository = "https://github.com/emk/toyos.rs" 9 | readme = "README.md" 10 | keywords = ["no_std", "kernel", "io"] 11 | license = "MIT" 12 | -------------------------------------------------------------------------------- /libs/range_inclusive/.gitignore: -------------------------------------------------------------------------------- 1 | # Generated by Cargo 2 | /target/ 3 | -------------------------------------------------------------------------------- /libs/range_inclusive/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["Ramla Ijaz "] 3 | name = "range_inclusive" 4 | description = "An implementation of RangeInclusive with an iterator that doesn't mutate the range." 5 | version = "0.1.0" 6 | -------------------------------------------------------------------------------- /libs/stdio/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "stdio" 3 | version = "0.1.0" 4 | authors = ["Zhiyao Ma "] 5 | 6 | [dependencies] 7 | spin = "0.9.4" 8 | core2 = { version = "0.4.0", default-features = false, features = ["alloc", "nightly"] } 9 | 10 | [dependencies.keycodes_ascii] 11 | path = "../keycodes_ascii" 12 | 13 | [lib] 14 | crate-type = ["rlib"] 15 | -------------------------------------------------------------------------------- /libs/str_ref/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["Kevin Boos "] 3 | name = "str_ref" 4 | description = "A shared immutable reference to a `str`, essentially `Arc` that is borrowable as a byte slice" 5 | version = "0.1.0" 6 | 7 | -------------------------------------------------------------------------------- /libs/sync/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "sync" 3 | version = "0.1.0" 4 | description = "Synchronisation primitive building blocks" 5 | edition = "2021" 6 | 7 | [dependencies.spin_rs] 8 | package = "spin" 9 | git = "https://github.com/theseus-os/spin-rs" 10 | default-features = false 11 | features = ["spin_mutex", "rwlock"] 12 | -------------------------------------------------------------------------------- /libs/sync_irq/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "sync_irq" 3 | version = "0.1.0" 4 | description = "Interrupt-request-disabling synchronisation primitives" 5 | edition = "2021" 6 | 7 | [dependencies] 8 | irq_safety = { git = "https://github.com/theseus-os/irq_safety" } 9 | sync = { path = "../sync" } 10 | -------------------------------------------------------------------------------- /libs/sync_spin/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "sync_spin" 3 | version = "0.1.0" 4 | description = "Spin-based synchronisation primitives" 5 | edition = "2021" 6 | 7 | [dependencies] 8 | sync = { path = "../sync" } 9 | -------------------------------------------------------------------------------- /libs/sync_spin/src/lib.rs: -------------------------------------------------------------------------------- 1 | #![no_std] 2 | 3 | pub type Mutex = sync::Mutex; 4 | pub type MutexGuard<'a, T> = sync::MutexGuard<'a, T, Spin>; 5 | 6 | pub type SpinMutex = Mutex; 7 | pub type SpinMutexGuard<'a, T> = MutexGuard<'a, T>; 8 | 9 | pub type RwLock = sync::RwLock; 10 | pub type RwLockReadGuard<'a, T> = sync::RwLockReadGuard<'a, T, Spin>; 11 | pub type RwLockWriteGuard<'a, T> = sync::RwLockWriteGuard<'a, T, Spin>; 12 | 13 | pub type SpinRwLock = RwLock; 14 | pub type SpinRwLockReadGuard<'a, T> = RwLockReadGuard<'a, T>; 15 | pub type SpinRwLockWriteGuard<'a, T> = RwLockWriteGuard<'a, T>; 16 | 17 | /// A no-op deadlock prevention method. 18 | #[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)] 19 | pub struct Spin {} 20 | 21 | impl sync::DeadlockPrevention for Spin { 22 | type Guard = (); 23 | 24 | const EXPENSIVE: bool = false; 25 | 26 | #[inline] 27 | fn enter() -> Self::Guard { 28 | () 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /libtheseus/src/my_mod.rs: -------------------------------------------------------------------------------- 1 | pub fn my_mod_func() { 2 | logger::write_fmt(format_args!("\n\nHello from my_mod_func!")).unwrap(); 3 | } 4 | -------------------------------------------------------------------------------- /old_crates/dbus/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["Wenqiu Yu "] 3 | name = "dbus" 4 | description = "Simple dbus-like IPC support" 5 | version = "0.1.0" 6 | 7 | [dependencies] 8 | spin = "0.9.4" 9 | 10 | 11 | [dependencies.log] 12 | version = "0.4.8" 13 | 14 | [dependencies.irq_safety] 15 | git = "https://github.com/theseus-os/irq_safety" 16 | 17 | 18 | [lib] 19 | crate-type = ["rlib"] 20 | -------------------------------------------------------------------------------- /old_crates/immediate_input_echo/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "immediate_input_echo" 3 | version = "0.1.0" 4 | authors = ["Zhiyao Ma "] 5 | 6 | [dependencies] 7 | core2 = { version = "0.4.0", default-features = false, features = ["alloc", "nightly"] } 8 | 9 | [dependencies.stdio] 10 | path = "../../libs/stdio" 11 | 12 | [dependencies.app_io] 13 | path = "../../kernel/app_io" 14 | 15 | [dependencies.log] 16 | version = "0.4.8" 17 | 18 | [lib] 19 | crate-type = ["rlib"] 20 | -------------------------------------------------------------------------------- /old_crates/input_echo/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "input_echo" 3 | version = "0.1.0" 4 | authors = ["Zhiyao Ma "] 5 | 6 | [dependencies] 7 | core2 = { version = "0.4.0", default-features = false, features = ["alloc", "nightly"] } 8 | 9 | [dependencies.app_io] 10 | path = "../../kernel/app_io" 11 | 12 | [dependencies.log] 13 | version = "0.4.8" 14 | 15 | [lib] 16 | crate-type = ["rlib"] 17 | -------------------------------------------------------------------------------- /old_crates/keyboard_echo/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "keyboard_echo" 3 | version = "0.1.0" 4 | authors = ["Zhiyao Ma "] 5 | 6 | [dependencies] 7 | core2 = { version = "0.4.0", default-features = false, features = ["alloc", "nightly"] } 8 | 9 | [dependencies.scheduler] 10 | path = "../../kernel/scheduler" 11 | 12 | [dependencies.app_io] 13 | path = "../../kernel/app_io" 14 | 15 | [dependencies.log] 16 | version = "0.4.8" 17 | 18 | [dependencies.keycodes_ascii] 19 | path = "../../libs/keycodes_ascii" 20 | 21 | [lib] 22 | crate-type = ["rlib"] 23 | -------------------------------------------------------------------------------- /old_crates/less/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "less" 3 | version = "0.1.0" 4 | authors = ["Zhiyao Ma "] 5 | 6 | [dependencies] 7 | getopts = "0.2.21" 8 | spin = "0.9.0" 9 | core2 = { version = "0.4.0", default-features = false, features = ["alloc", "nightly"] } 10 | 11 | [dependencies.task] 12 | path = "../../kernel/task" 13 | 14 | [dependencies.path] 15 | path = "../../kernel/path" 16 | 17 | [dependencies.fs_node] 18 | path = "../../kernel/fs_node" 19 | 20 | [dependencies.keycodes_ascii] 21 | path = "../../libs/keycodes_ascii" 22 | 23 | [dependencies.libterm] 24 | path = "../../kernel/libterm" 25 | 26 | [dependencies.app_io] 27 | path = "../../kernel/app_io" 28 | 29 | [dependencies.stdio] 30 | path = "../../libs/stdio" 31 | 32 | [dependencies.log] 33 | version = "0.4.8" 34 | 35 | 36 | [lib] 37 | crate-type = ["rlib"] 38 | -------------------------------------------------------------------------------- /old_crates/syscall/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["Kevin Boos "] 3 | name = "syscall" 4 | description = "Initializes the system call support, and provides basic handling and dispatching of syscalls in Theseus" 5 | version = "0.1.0" 6 | 7 | [dependencies] 8 | spin = "0.9.4" 9 | x86_64 = "0.14.8" 10 | 11 | 12 | [dependencies.log] 13 | version = "0.4.8" 14 | 15 | [dependencies.gdt] 16 | path = "../gdt" 17 | 18 | [dependencies.memory] 19 | path = "../memory" 20 | 21 | [dependencies.cpu] 22 | path = "../cpu" 23 | 24 | [dependencies.task] 25 | path = "../task" 26 | 27 | [dependencies.dbus] 28 | path = "../dbus" 29 | 30 | 31 | [lib] 32 | crate-type = ["rlib"] 33 | -------------------------------------------------------------------------------- /old_crates/userspace/Makefile: -------------------------------------------------------------------------------- 1 | SHELL := /bin/bash 2 | USERSPACE_BUILD_DIR ?= $(shell pwd)/build 3 | export # export this to Makefiles in subdirectories 4 | 5 | 6 | # get all the subdirectories for making 7 | SUBDIRS := $(wildcard */.) 8 | # except for the build directory 9 | SUBDIRS := $(filter-out build/., $(SUBDIRS)) 10 | 11 | 12 | .PHONY: all clean $(SUBDIRS) 13 | .DEFAULT_GOAL := all 14 | 15 | 16 | all: $(SUBDIRS) 17 | $(SUBDIRS): 18 | $(MAKE) -C $@ $(MAKECMDGOALS) 19 | 20 | 21 | ## simply runs make clean in all subdirs, then removes the userspace build dir 22 | clean: $(SUBDIRS) 23 | @rm -rf $(USERSPACE_BUILD_DIR) 24 | 25 | -------------------------------------------------------------------------------- /old_crates/userspace/simple_test/Makefile: -------------------------------------------------------------------------------- 1 | USERSPACE_BUILD_DIR ?= ../build 2 | 3 | .PHONY: all clean 4 | .DEFAULT_GOAL := all 5 | 6 | 7 | all: test_program.s 8 | @mkdir -p $(USERSPACE_BUILD_DIR) 9 | 10 | @nasm -f elf64 test_program.s -o $(USERSPACE_BUILD_DIR)/test_program.o 11 | @ld -o $(USERSPACE_BUILD_DIR)/test_program $(USERSPACE_BUILD_DIR)/test_program.o 12 | @rm $(USERSPACE_BUILD_DIR)/test_program.o 13 | @strip $(USERSPACE_BUILD_DIR)/test_program 14 | 15 | clean: 16 | @rm -rf $(USERSPACE_BUILD_DIR)/test_program* 17 | -------------------------------------------------------------------------------- /old_crates/userspace/simple_test/test_program.s: -------------------------------------------------------------------------------- 1 | BITS 64 2 | 3 | section .text 4 | 5 | global _start 6 | _start: 7 | main: 8 | mov rax, 1 9 | mov r12, 0xDEADBEEF01234567 10 | mov r14, 0x0123456789abcdef 11 | 12 | mov rcx, 0x1000000 13 | 14 | loopstart: 15 | 16 | add rax, 2 17 | 18 | dec rcx 19 | dec rcx 20 | dec rcx 21 | dec rcx 22 | jnz loopstart 23 | 24 | 25 | ; infinite loop 26 | jmp main 27 | -------------------------------------------------------------------------------- /old_crates/userspace/syscall_test/Makefile: -------------------------------------------------------------------------------- 1 | USERSPACE_BUILD_DIR ?= ../build 2 | 3 | .PHONY: all clean 4 | .DEFAULT_GOAL := all 5 | 6 | 7 | all: syscall_send.s syscall_receive.s 8 | @mkdir -p $(USERSPACE_BUILD_DIR) 9 | 10 | @nasm -f elf64 syscall_receive.s -o $(USERSPACE_BUILD_DIR)/syscall_receive.o 11 | @ld -o $(USERSPACE_BUILD_DIR)/syscall_receive $(USERSPACE_BUILD_DIR)/syscall_receive.o 12 | @rm $(USERSPACE_BUILD_DIR)/syscall_receive.o 13 | 14 | @nasm -f elf64 syscall_send.s -o $(USERSPACE_BUILD_DIR)/syscall_send.o 15 | @ld -o $(USERSPACE_BUILD_DIR)/syscall_send $(USERSPACE_BUILD_DIR)/syscall_send.o 16 | @rm $(USERSPACE_BUILD_DIR)/syscall_send.o 17 | 18 | clean: 19 | @rm -rf $(USERSPACE_BUILD_DIR)/syscall_send* \ 20 | $(USERSPACE_BUILD_DIR)/syscall_receive* 21 | -------------------------------------------------------------------------------- /old_crates/userspace/syscall_test/syscall_receive.s: -------------------------------------------------------------------------------- 1 | BITS 64 2 | section .data 3 | dest db 'receiver' 4 | 5 | section .text 6 | global _start 7 | _start: 8 | 9 | ; rax -- syscall number 10 | ; rdi -- first argument 11 | ; rsi -- second argument 12 | ; rdx -- third argument 13 | ; r10 -- fourth argument 14 | ; r9 -- fifth argument 15 | ; r8 -- sixth argument 16 | 17 | main: 18 | mov rax, 2 ; syscall #2 is sysrecv 19 | 20 | mov rdi, dest 21 | mov rsi, "default"; rsi is the pointer to the received msg 22 | mov rdx, 5 23 | mov r10, 8 24 | mov r8 , 13 25 | mov r9 , 21 26 | 27 | push rbx 28 | syscall 29 | pop rbx 30 | 31 | mov rcx, 0x4000000 32 | 33 | 34 | loopstart: 35 | 36 | ;add rax, 1 37 | 38 | dec rcx 39 | jnz loopstart 40 | 41 | mov rax, rbx 42 | 43 | 44 | 45 | ; infinite loop 46 | jmp main 47 | -------------------------------------------------------------------------------- /ports/README.md: -------------------------------------------------------------------------------- 1 | # `ports/`: Third-party Libraries Ported to Theseus 2 | 3 | This directory contains libraries that have been ported to use Theseus-specific functions and types, and can depend directly upon Theseus crates in `kernel/`. 4 | This is in contrast to `libs/`, which contains third-party libraries that are standalone and cannot depend on Theseus crates. 5 | 6 | Most of these folders are git submodules (separate repositories) in order to preserve the history of each crate and link back to the original crate. 7 | -------------------------------------------------------------------------------- /ports/theseus_std/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["Kevin Boos "] 3 | name = "theseus_std" 4 | description = "Theseus port of select parts of the Rust standard library `std`" 5 | version = "0.1.0" 6 | edition = "2018" 7 | 8 | [dependencies] 9 | lockable = { path = "../../libs/lockable" } 10 | theseus_task = { path = "../../kernel/task", package = "task" } 11 | theseus_path = { path = "../../kernel/path", package = "path" } 12 | theseus_fs_node = { path = "../../kernel/fs_node", package = "fs_node" } 13 | theseus_io = { path = "../../kernel/io", package = "io" } 14 | theseus_memfs = { path = "../../kernel/memfs", package = "memfs" } 15 | spin = "0.9.4" 16 | core2 = { version = "0.4.0", default-features = false, features = ["alloc", "nightly"] } 17 | -------------------------------------------------------------------------------- /ports/theseus_std/src/lib.rs: -------------------------------------------------------------------------------- 1 | //! A Theseus-specific port of parts of the Rust standard library `std`. 2 | //! 3 | //! Current ported modules include: 4 | //! * `fs`: basic filesystem access. 5 | //! * `os_str`: platform-native string types. 6 | //! * In Theseus, `OsString` = `String`, and `OsStr` = `str`. 7 | //! * `path`: basic path representations: `PathBuf` and `Path`. 8 | //! 9 | 10 | #![no_std] 11 | #![feature(extend_one)] 12 | #![feature(trait_alias)] 13 | 14 | extern crate alloc; 15 | 16 | mod env; 17 | pub mod fs; 18 | mod fs_imp; 19 | pub mod os_str; 20 | mod os_str_imp; 21 | pub mod path; 22 | mod sys_common; 23 | 24 | 25 | // Taken from: 26 | mod sealed { 27 | /// This trait being unreachable from outside the crate 28 | /// prevents outside implementations of our extension traits. 29 | /// This allows adding more trait methods in the future. 30 | pub trait Sealed {} 31 | } 32 | -------------------------------------------------------------------------------- /ports/theseus_std/src/sys_common.rs: -------------------------------------------------------------------------------- 1 | //! So far, this includes only the `*Inner` conversion traits from the std library. 2 | //! 3 | //! Taken from 4 | //! 5 | 6 | /// A trait for viewing representations from std types 7 | #[doc(hidden)] 8 | pub trait AsInner { 9 | fn as_inner(&self) -> &Inner; 10 | } 11 | 12 | /// A trait for viewing representations from std types 13 | #[doc(hidden)] 14 | pub trait AsInnerMut { 15 | fn as_inner_mut(&mut self) -> &mut Inner; 16 | } 17 | 18 | /// A trait for extracting representations from std types 19 | #[doc(hidden)] 20 | pub trait IntoInner { 21 | fn into_inner(self) -> Inner; 22 | } 23 | 24 | /// A trait for creating std types from internal representations 25 | #[doc(hidden)] 26 | pub trait FromInner { 27 | fn from_inner(inner: Inner) -> Self; 28 | } 29 | -------------------------------------------------------------------------------- /rust-toolchain.toml: -------------------------------------------------------------------------------- 1 | [toolchain] 2 | channel = "nightly-2023-10-27" 3 | components = [ "rust-src", "clippy" ] 4 | ## Rustup always installs the host target by default, so we don't need to specify it here. 5 | ## All we need to specify is the uefi targets used to build our `uefi-bootloader`. 6 | targets = [ "x86_64-unknown-uefi", "aarch64-unknown-uefi" ] 7 | profile = "default" 8 | -------------------------------------------------------------------------------- /rustfmt.toml: -------------------------------------------------------------------------------- 1 | ignore = [ 2 | "/applications", 3 | "/compiler_plugins", 4 | "/kernel", 5 | "/libs", 6 | "/libtheseus", 7 | "/old_crates", 8 | "/ports", 9 | "/theseus_features", 10 | "/tlibc", 11 | "/tools" 12 | ] 13 | -------------------------------------------------------------------------------- /scripts/elfdiff.sh: -------------------------------------------------------------------------------- 1 | readelf -aW $1 > /tmp/elfdiff1 2 | readelf -aW $2 > /tmp/elfdiff2 3 | readelf -aW $3 > /tmp/elfdiff3 4 | readelf -aW $4 > /tmp/elfdiff4 5 | vimdiff /tmp/elfdiff1 /tmp/elfdiff2 /tmp/elfdiff3 /tmp/elfdiff4 6 | -------------------------------------------------------------------------------- /scripts/find_simd_instr.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | for objfile in "$@" 4 | do 5 | if grep -q ymm <(objdump -C -d $objfile) 6 | then 7 | echo -e "\033[0;32m$objfile has AVX instructions.\033[0m" 8 | elif grep -q xmm <(objdump -C -d $objfile) 9 | then 10 | echo -e "\033[0;31m$objfile has SSE instructions.\033[0m" 11 | else 12 | echo "$objfile does NOT have SIMD instructions." 13 | fi 14 | done 15 | 16 | -------------------------------------------------------------------------------- /scripts/graph.sh: -------------------------------------------------------------------------------- 1 | ### If you don't have cargo deps installed, run this: cargo +nightly install --git https://github.com/kbknapp/cargo-graph --force 2 | if cargo --list | grep deps; then 3 | cargo deps --include-orphans --no-transitive-deps | dot -Tpdf > /tmp/graph.pdf && xdg-open /tmp/graph.pdf 4 | else 5 | echo -e "\nPlease install cargo-deps with the following command:\n\tcargo install cargo-deps --force" 6 | fi 7 | -------------------------------------------------------------------------------- /scripts/objdiff.sh: -------------------------------------------------------------------------------- 1 | objdump -d -C $1 > /tmp/objdiff1 2 | objdump -d -C $2 > /tmp/objdiff2 3 | objdump -d -C $3 > /tmp/objdiff3 4 | objdump -d -C $4 > /tmp/objdiff4 5 | vimdiff /tmp/objdiff1 /tmp/objdiff2 /tmp/objdiff3 /tmp/objdiff4 6 | -------------------------------------------------------------------------------- /scripts/objlist.sh: -------------------------------------------------------------------------------- 1 | echo "" > /tmp/objfiles 2 | for objfile in "$@" 3 | do 4 | echo "######################################################################" >> /tmp/objfiles 5 | echo "$(basename $objfile)" >> /tmp/objfiles 6 | echo "######################################################################" >> /tmp/objfiles 7 | objdump -d -C $objfile >> /tmp/objfiles 8 | echo -e "\n\n" >> /tmp/objfiles 9 | done 10 | 11 | vim /tmp/objfiles 12 | 13 | -------------------------------------------------------------------------------- /scripts/test_simple_tap.sh: -------------------------------------------------------------------------------- 1 | sudo ip tuntap add name tap0 mode tap user $USER 2 | sudo ip link set tap0 up 3 | sudo ip addr add 192.168.69.100/24 dev tap0 4 | 5 | -------------------------------------------------------------------------------- /tlibc/.gitignore: -------------------------------------------------------------------------------- 1 | target/ 2 | -------------------------------------------------------------------------------- /tlibc/include/stdarg.h: -------------------------------------------------------------------------------- 1 | #ifndef _STDARG_H 2 | #define _STDARG_H 3 | 4 | typedef __builtin_va_list va_list; 5 | #define va_start(v,l) __builtin_va_start(v,l) 6 | #define va_end(v) __builtin_va_end(v) 7 | #define va_arg(v,l) __builtin_va_arg(v,l) 8 | #define va_copy(d,s) __builtin_va_copy(d,s) 9 | 10 | #endif /* _STDARG_H */ 11 | -------------------------------------------------------------------------------- /tlibc/include/stddef.h: -------------------------------------------------------------------------------- 1 | #ifndef _STDDEF_H 2 | #define _STDDEF_H 3 | #include 4 | 5 | #define NULL 0 6 | 7 | #ifndef __PTRDIFF_TYPE__ 8 | #define __PTRDIFF_TYPE__ long int 9 | #endif 10 | typedef __PTRDIFF_TYPE__ ptrdiff_t; 11 | 12 | #ifndef __cplusplus 13 | typedef int32_t wchar_t; 14 | #endif /* #ifndef __cplusplus */ 15 | typedef int32_t wint_t; 16 | 17 | 18 | typedef long unsigned int size_t; 19 | 20 | typedef struct { long long __ll; long double __ld; } max_align_t; 21 | 22 | #define offsetof(type, member) __builtin_offsetof(type, member) 23 | 24 | #endif /* _STDDEF_H */ 25 | -------------------------------------------------------------------------------- /tlibc/include/stdio.h: -------------------------------------------------------------------------------- 1 | #ifndef _BITS_STDIO_H 2 | #define _BITS_STDIO_H 3 | 4 | #include 5 | 6 | // XXX: this is only here because cbindgen can't handle string constants 7 | #define P_tmpdir "/tmp" 8 | 9 | typedef struct FILE FILE; 10 | 11 | // A typedef doesn't suffice, because libgmp uses this definition to check if 12 | // STDIO was loaded. 13 | #define FILE FILE 14 | 15 | #ifdef __cplusplus 16 | extern "C" { 17 | #endif 18 | 19 | int asprintf(char **strp, const char * fmt, ...); 20 | // int fprintf(FILE * stream, const char * fmt, ...); 21 | int printf(const char * fmt, ...); 22 | int snprintf(char *s, size_t n, const char * fmt, ...); 23 | int sprintf(char *s, const char * fmt, ...); 24 | // int fscanf(FILE * stream, const char * fmt, ...); 25 | // int scanf(const char * fmt, ...); 26 | // int sscanf(const char * input, const char * fmt, ...); 27 | 28 | #ifdef __cplusplus 29 | } // extern "C" 30 | #endif 31 | 32 | #endif /* _BITS_STDIO_H */ 33 | -------------------------------------------------------------------------------- /tlibc/include/strings.h: -------------------------------------------------------------------------------- 1 | #ifndef _STRINGS_H 2 | #define _STRINGS_H 3 | 4 | #include 5 | #include 6 | 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif // __cplusplus 10 | 11 | int bcmp(const void *first, const void *second, size_t n); 12 | 13 | void bcopy(const void *src, void *dst, size_t n); 14 | 15 | void bzero(void *dst, size_t n); 16 | 17 | int ffs(int i); 18 | 19 | char *index(const char *s, int c); 20 | 21 | char *rindex(const char *s, int c); 22 | 23 | int strcasecmp(const char *first, const char *second); 24 | 25 | int strncasecmp(const char *first, const char *second, size_t n); 26 | 27 | #ifdef __cplusplus 28 | } // extern "C" 29 | #endif // __cplusplus 30 | 31 | #endif /* _STRINGS_H */ 32 | -------------------------------------------------------------------------------- /tlibc/src/globals.rs: -------------------------------------------------------------------------------- 1 | use core::ptr; 2 | use alloc::vec::Vec; 3 | use libc::{c_char}; 4 | 5 | pub static mut argv: *mut *mut c_char = ptr::null_mut(); 6 | pub static mut inner_argv: Vec<*mut c_char> = Vec::new(); 7 | 8 | /// Externally-accessible from C 9 | #[no_mangle] 10 | pub static mut environ: *mut *mut c_char = ptr::null_mut(); 11 | pub static mut inner_environ: Vec<*mut c_char> = Vec::new(); 12 | 13 | 14 | 15 | #[no_mangle] 16 | pub unsafe extern "C" fn __program_invocation_name() -> *mut *mut c_char { 17 | &mut inner_argv[0] 18 | } 19 | -------------------------------------------------------------------------------- /tools/copy_latest_crate_objects/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "copy_latest_crate_objects" 3 | version = "0.1.0" 4 | authors = [ 5 | "Kevin Boos ", 6 | ] 7 | description = "Copies the latest object file for each first-party Theseus crate into the OS image" 8 | 9 | [dependencies] 10 | getopts = "0.2" 11 | walkdir = "2.2.7" -------------------------------------------------------------------------------- /tools/demangle_readelf_file/Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | version = 3 4 | 5 | [[package]] 6 | name = "demangle_symbol" 7 | version = "0.1.0" 8 | dependencies = [ 9 | "getopts", 10 | "rustc-demangle", 11 | ] 12 | 13 | [[package]] 14 | name = "getopts" 15 | version = "0.2.17" 16 | source = "registry+https://github.com/rust-lang/crates.io-index" 17 | checksum = "b900c08c1939860ce8b54dc6a89e26e00c04c380fd0e09796799bd7f12861e05" 18 | 19 | [[package]] 20 | name = "rustc-demangle" 21 | version = "0.1.14" 22 | source = "registry+https://github.com/rust-lang/crates.io-index" 23 | checksum = "ccc78bfd5acd7bf3e89cffcf899e5cb1a52d6fafa8dec2739ad70c9577a57288" 24 | -------------------------------------------------------------------------------- /tools/demangle_readelf_file/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "demangle_symbol" 3 | version = "0.1.0" 4 | authors = ["Kevin Boos "] 5 | 6 | [dependencies] 7 | rustc-demangle = "0.1.14" 8 | getopts = "0.2" 9 | -------------------------------------------------------------------------------- /tools/diff_crates/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "diff_crates" 3 | version = "0.1.0" 4 | description = "A tool for differencing crates' object files across builds of Theseus to see what has changed" 5 | authors = ["Kevin Boos "] 6 | 7 | 8 | [dependencies] 9 | getopts = "0.2" 10 | walkdir = "2.2.7" 11 | qp-trie = "0.8.1" 12 | multimap = "0.4.0" 13 | spin = "0.9.4" 14 | serde_json = "1.0.39" -------------------------------------------------------------------------------- /tools/elf_cls/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "elf_cls" 3 | version = "0.1.0" 4 | authors = ["Klim Tsoutsman "] 5 | description = "Tool that prepares ELF files with CPU local sections to be loaded by Theseus" 6 | edition = "2021" 7 | 8 | [dependencies] 9 | crate_metadata_serde = { path = "../../kernel/crate_metadata_serde" } 10 | goblin = "0.7" 11 | -------------------------------------------------------------------------------- /tools/get_tty/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "get_tty" 3 | description = "Gets the next free TTY" 4 | version = "0.1.0" 5 | edition = "2021" 6 | 7 | [dependencies] 8 | pty = "0.2.2" 9 | -------------------------------------------------------------------------------- /tools/get_tty/src/main.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | let fork = pty::fork::Fork::from_ptmx().unwrap(); 3 | if let Some(master) = fork.is_parent().ok() { 4 | let name_ptr = master.ptsname().unwrap(); 5 | let name = unsafe { core::ffi::CStr::from_ptr(name_ptr) } 6 | .to_str() 7 | .unwrap(); 8 | println!("{name}"); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /tools/grub_cfg_generation/Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | version = 3 4 | 5 | [[package]] 6 | name = "getopts" 7 | version = "0.2.17" 8 | source = "registry+https://github.com/rust-lang/crates.io-index" 9 | checksum = "b900c08c1939860ce8b54dc6a89e26e00c04c380fd0e09796799bd7f12861e05" 10 | 11 | [[package]] 12 | name = "grub_cfg_generation" 13 | version = "0.1.0" 14 | dependencies = [ 15 | "getopts", 16 | ] 17 | -------------------------------------------------------------------------------- /tools/grub_cfg_generation/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "grub_cfg_generation" 3 | version = "0.1.0" 4 | authors = [ 5 | "Kevin Boos ", 6 | "christinewang5 ", 7 | ] 8 | description = "Parses the directory of built object files and generates the multiboot2-compliant grub.cfg file" 9 | 10 | [dependencies] 11 | getopts = "0.2" -------------------------------------------------------------------------------- /tools/limine_compress_modules/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "limine_compress_modules" 3 | version = "0.1.0" 4 | authors = [ 5 | "Nathan Royer ", 6 | ] 7 | description = "Compresses a file in the LZ4 format and prepend the compressed data with its original size" 8 | 9 | [dependencies] 10 | getopts = "0.2" 11 | lz4_flex = "0.9.3" 12 | -------------------------------------------------------------------------------- /tools/receive_udp_messages/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "test_udp_server" 3 | version = "0.1.0" 4 | authors = ["nisalmenuka2 "] 5 | 6 | [dependencies] 7 | -------------------------------------------------------------------------------- /tools/receive_udp_messages/README.txt: -------------------------------------------------------------------------------- 1 | 2 | #Setting up host machine if QEMU is used 3 | sudo ip tuntap add name tap0 mode tap user $USER 4 | sudo ip link set tap0 up 5 | sudo ip addr add 192.168.69.100/24 dev tap0 6 | 7 | #Use the setup.sh script with sudo command to setup the host machine 8 | 9 | 10 | #Sending UDP packet using socat 11 | socat stdio udp4-connect:192.168.66969 <<<"abcdefg" 12 | 13 | #Sample test program that can be used from the connected machine to receive the udp packets 14 | -------------------------------------------------------------------------------- /tools/receive_udp_messages/setup.sh: -------------------------------------------------------------------------------- 1 | sudo ip tuntap add name tap0 mode tap user $USER 2 | sudo ip link set tap0 up 3 | sudo ip addr add 192.168.69.100/24 dev tap0 -------------------------------------------------------------------------------- /tools/receive_udp_messages/src/main.rs: -------------------------------------------------------------------------------- 1 | 2 | use std::net::UdpSocket; 3 | use std::str; 4 | 5 | fn main() { 6 | let socket = UdpSocket::bind("192.168.69.100:5901").expect("couldn't bind to address"); 7 | let s = b"abcdef"; 8 | let mut i = 0; 9 | while i < 30 { 10 | let mut buf = [0; 100]; 11 | let (number_of_bytes, src_addr) = socket.recv_from(&mut buf).expect("Didn't receive data"); 12 | let filled_buf = &mut buf[..number_of_bytes]; 13 | 14 | let mut s = str::from_utf8(filled_buf); 15 | match s { 16 | Result::Ok(s1) => println!("{}",s1), 17 | Result::Err(err) => (), 18 | } 19 | 20 | i = i +1; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /tools/serialize_nano_core/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "serialize_nano_core" 3 | version = "0.1.0" 4 | edition = "2021" 5 | authors = ["Klim Tsoutsman "] 6 | description = "Creates a serialized representation of the symbols in the `nano_core` binary" 7 | 8 | [dependencies] 9 | crate_metadata_serde = { path = "../../kernel/crate_metadata_serde" } 10 | kernel_config = { path = "../../kernel/kernel_config" } 11 | hashbrown = "0.11" 12 | serde = { version = "1.0", features = ["derive"] } 13 | 14 | [dependencies.bincode] 15 | version = "2.0.0-rc.1" 16 | features = ["serde"] 17 | -------------------------------------------------------------------------------- /tools/theseus_cargo/.gitignore: -------------------------------------------------------------------------------- 1 | # Build directories 2 | target/ 3 | bin/ 4 | .crates* 5 | -------------------------------------------------------------------------------- /tools/theseus_cargo/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "theseus_cargo" 3 | version = "0.1.0" 4 | authors = [ 5 | "Kevin Boos ", 6 | ] 7 | description = "A wrapper around cargo that cross-compiles Theseus components, handles out-of-tree builds based on a set of pre-built Theseus crate .rlibs, and performs special partially-static linking procedures." 8 | 9 | [dependencies] 10 | getopts = "0.2" 11 | walkdir = "2.2.7" 12 | regex = "1.4.2" 13 | itertools = "0.9.0" 14 | clap = "2.33.3" 15 | toml = "0.5.7" 16 | serde = { version = "1.0", features = ["derive"] } -------------------------------------------------------------------------------- /tools/uefi_builder/README.md: -------------------------------------------------------------------------------- 1 | Using different crates for different targets is necessary until [rust-lang/ 2 | cargo/10030][1] is implemented. 3 | 4 | If you encounter: 5 | ``` 6 | error: no matching package named `bootloader` found 7 | ```` 8 | Try compiling with `-Z bindeps`. 9 | 10 | [1]: https://github.com/rust-lang/cargo/issues/10030 11 | -------------------------------------------------------------------------------- /tools/uefi_builder/aarch64/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "uefi_builder_aarch64" 3 | version = "0.1.0" 4 | authors = ["Klim Tsoutsman "] 5 | description = "Creates the files necessary to boot Theseus using UEFI on aarch64" 6 | edition = "2021" 7 | 8 | [dependencies] 9 | uefi_builder_common = { path = "../common" } 10 | 11 | [dependencies.uefi-bootloader] 12 | artifact = "bin" 13 | git = "https://github.com/theseus-os/uefi-bootloader" 14 | target = "aarch64-unknown-uefi" 15 | 16 | [patch.crates-io] 17 | uefi-macros = { git = "https://github.com/rust-osdev/uefi-rs" } 18 | -------------------------------------------------------------------------------- /tools/uefi_builder/aarch64/src/main.rs: -------------------------------------------------------------------------------- 1 | use std::path::Path; 2 | 3 | fn main() { 4 | uefi_builder_common::main( 5 | Path::new(env!("CARGO_BIN_FILE_UEFI_BOOTLOADER")), 6 | Path::new("efi/boot/bootaa64.efi"), 7 | ); 8 | } 9 | -------------------------------------------------------------------------------- /tools/uefi_builder/common/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "uefi_builder_common" 3 | version = "0.1.0" 4 | authors = ["Klim Tsoutsman "] 5 | descriptions = "Architecture-agnostic functionality for creating UEFI-compatible boot images" 6 | edition = "2021" 7 | 8 | [dependencies] 9 | anyhow = "1.0" 10 | clap = { version = "4.0", features = ["derive"] } 11 | fatfs = "0.3" 12 | gpt = "3.0" 13 | tempfile = "3.3" 14 | -------------------------------------------------------------------------------- /tools/uefi_builder/x86_64/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "uefi_builder_x86_64" 3 | version = "0.1.0" 4 | authors = ["Klim Tsoutsman "] 5 | description = "Creates the files necessary to boot Theseus using UEFI on x86_64" 6 | edition = "2021" 7 | 8 | [dependencies] 9 | uefi_builder_common = { path = "../common" } 10 | 11 | [dependencies.uefi-bootloader] 12 | artifact = "bin" 13 | git = "https://github.com/theseus-os/uefi-bootloader" 14 | target = "x86_64-unknown-uefi" 15 | 16 | [patch.crates-io] 17 | uefi-macros = { git = "https://github.com/rust-osdev/uefi-rs" } 18 | -------------------------------------------------------------------------------- /tools/uefi_builder/x86_64/src/main.rs: -------------------------------------------------------------------------------- 1 | use std::path::Path; 2 | 3 | fn main() { 4 | uefi_builder_common::main( 5 | Path::new(env!("CARGO_BIN_FILE_UEFI_BOOTLOADER")), 6 | Path::new("efi/boot/bootx64.efi"), 7 | ); 8 | } 9 | --------------------------------------------------------------------------------