├── .dockerignore ├── .gitignore ├── .gitmodules ├── 3rdparty ├── .gitignore ├── check-license-mit.txt ├── check-license.sh ├── ihkreboot.sh ├── ihkstop+release.sh ├── install-bochs ├── install-ihk.sh ├── install-libcxx.sh ├── irqbalance_mck.in ├── libcxx-classictable.patch ├── libcxx-musl-compat.patch └── libcxx-nolinux.patch ├── AUTHORS ├── Dockerfile ├── LICENSE ├── Makefile ├── Makefile.user ├── README.md ├── arch-config ├── arch-amd64.module ├── arch-ihk.module └── arch-knc.module ├── doc ├── base-kernel │ ├── .gitignore │ ├── Makefile │ ├── MyThOS_Logo.pdf │ ├── MyThOS_Logo.svg │ ├── base-kernel.pdf │ ├── fig │ │ ├── DSC01686.JPG │ │ ├── DSC01687.JPG │ │ ├── DSC01705.JPG │ │ ├── DerivedReferenceBits.dia │ │ ├── DerivedReferenceBits.pdf │ │ ├── ExecutionContext.dia │ │ ├── ExecutionContext.pdf │ │ ├── KernelObject.pdf │ │ ├── KernelObject.tex │ │ ├── Makefile │ │ ├── cap-tree.dia │ │ ├── cap-tree.pdf │ │ ├── capability-model.dia │ │ ├── capability-model.pdf │ │ ├── capability-model.svg │ │ ├── capability-states.dia │ │ ├── capability-states.pdf │ │ ├── entry.dia │ │ ├── entry.pdf │ │ ├── error-propagation.pdf │ │ ├── error-propagation.svg │ │ ├── kernel-object-cap.dia │ │ ├── kernel-object-cap.pdf │ │ ├── kernel-objects-logical.dia │ │ ├── kernel-objects-logical.pdf │ │ ├── mcconf.dia │ │ ├── mcconf.pdf │ │ ├── portal.dia │ │ ├── portal.pdf │ │ ├── recdepth.dia │ │ ├── recdepth.pdf │ │ ├── tasklet-class.dia │ │ ├── tasklet-class.pdf │ │ └── template_ba.pgs │ ├── kernelsched.tex │ ├── literature.bib │ ├── main.tex │ ├── overview.tex │ ├── preface.tex │ ├── slides │ │ ├── Makefile │ │ ├── appendix.tex │ │ ├── beamercolorthemebtu.sty │ │ ├── beamercolorthemefak1.sty │ │ ├── beamerfontthemebtu.sty │ │ ├── beamerinnerthemebtu.sty │ │ ├── beamerouterthemebtu.sty │ │ ├── beamerthemebtu.sty │ │ ├── btulogo.sty │ │ ├── figures │ │ │ ├── 3-3-a.jpg │ │ │ ├── Makefile │ │ │ ├── asyncobj.pdf │ │ │ ├── asyncobj.svg │ │ │ ├── cap-tree.dia │ │ │ ├── cap-tree.pdf │ │ │ ├── continuations.dia │ │ │ ├── continuations.pdf │ │ │ ├── hw-xeonphi-host.pdf │ │ │ ├── hw-xeonphi.pdf │ │ │ ├── layers.pdf │ │ │ ├── layers.svg │ │ │ ├── manycore.R │ │ │ ├── manycore.csv │ │ │ ├── manycore.pdf │ │ │ ├── mem-balancing.dia │ │ │ ├── mem-balancing.pdf │ │ │ ├── syscall-kernel-obj.dia │ │ │ ├── syscall-kernel-obj.pdf │ │ │ ├── syscall-stub.dia │ │ │ ├── syscall-stub.pdf │ │ │ ├── syscall.pdf │ │ │ ├── syscall.svg │ │ │ ├── tasklet-class.dia │ │ │ ├── tasklet-class.pdf │ │ │ ├── triangle.pdf │ │ │ ├── triangle.svg │ │ │ ├── um-ops.dia │ │ │ └── um-ops.pdf │ │ ├── highlighter.sty │ │ ├── main.tex │ │ ├── muell.tex │ │ └── mythos-logo.pdf │ ├── tasklet-demo │ │ ├── .gitignore │ │ ├── Makefile │ │ ├── MonitorHomed.h │ │ ├── Place.h │ │ ├── Tasklet.h │ │ ├── ThreadGroup.hh │ │ ├── TscClock.h │ │ ├── cpuid.hh │ │ ├── main.cc │ │ ├── puma.cc │ │ └── trace.h │ └── x64.tex ├── deliverables │ ├── .gitignore │ ├── D2_2_Gesamtarchitektur.tex │ ├── D2_3_Architekturplan.tex │ ├── D3_2_Finaler_Prototyp.tex │ ├── D3_3_Entwicklungsplan.tex │ ├── D4_2_2_Developer_Tools.tex │ ├── D4_3_Developer_Cookbook.tex │ ├── D5_2_Infrastruktur_Evaluierung.tex │ ├── Makefile │ ├── MyThOS_Logo.pdf │ ├── MyThOS_Logo.svg │ ├── data │ │ ├── mobileObjectHighWorkloadMeans.csv │ │ └── mobileObjectLowWorkloadMeans.csv │ ├── fig │ │ ├── DerivedReferenceBits.pdf │ │ ├── Makefile │ │ ├── cap-tree.pdf │ │ ├── capability-model.pdf │ │ ├── capability-states.pdf │ │ ├── kernel-object-cap.pdf │ │ ├── kernel-objects-logical.pdf │ │ ├── layers.pdf │ │ ├── portal.pdf │ │ └── tasklet-class.pdf │ ├── header.tex │ └── literature.bib ├── execution-context.md ├── ihk_integration.txt └── install.md ├── host-knc.config ├── kernel-amd64.config ├── kernel-ihk.config ├── kernel-knc.config └── kernel ├── app ├── init-example │ ├── app │ │ └── init.cc │ └── mcconf.module └── process_test │ ├── app │ └── images.S │ ├── mcconf.module │ └── process_test │ ├── mlog.cc │ └── process_test.cc ├── async ├── mlog │ ├── async │ │ ├── mlog.cc │ │ └── mlog.hh │ └── mcconf.module ├── monitor-common │ ├── async │ │ ├── DeletionMonitor.hh │ │ ├── IResult.hh │ │ ├── KFuture.hh │ │ ├── Place.cc │ │ ├── Place.hh │ │ ├── Tasklet.hh │ │ ├── TaskletQueue.hh │ │ └── notes.md │ └── mcconf.module ├── monitor-delegating │ ├── async │ │ ├── DelegationQueue.hh │ │ └── MonitorDelegating.hh │ └── mcconf.module ├── monitor-homed │ ├── async │ │ ├── MonitorHomed.hh │ │ └── Queues.hh │ └── mcconf.module ├── monitor-stateless │ ├── async │ │ └── MonitorStateless.hh │ └── mcconf.module ├── mutex-delegating │ ├── async │ │ ├── MutexDelegating.cc │ │ └── MutexDelegating.hh │ ├── mcconf.module │ └── util │ │ └── ThreadMutex.hh ├── nested-monitor-delegating │ ├── async │ │ ├── NestedMonitorDelegating.cc │ │ └── NestedMonitorDelegating.hh │ └── mcconf.module ├── nested-monitor-dummy │ ├── async │ │ └── NestedMonitorDummy.hh │ └── mcconf.module ├── nested-monitor-home │ ├── async │ │ ├── NestedMonitorHome.cc │ │ └── NestedMonitorHome.hh │ └── mcconf.module ├── notes.md ├── simple-monitor-home │ ├── async │ │ └── SimpleMonitorHome.hh │ └── mcconf.module └── synchronous-task │ ├── async │ ├── SynchronousTask.hh │ └── test-SynchronousTask.cc │ └── mcconf.module ├── boot ├── apboot-acpi │ ├── boot │ │ ├── apboot.cc │ │ └── apboot.hh │ └── mcconf.module ├── apboot-common │ ├── boot │ │ ├── DeployHWThread.cc │ │ └── DeployHWThread.hh │ └── mcconf.module ├── apboot-ihk │ ├── boot │ │ ├── apboot.cc │ │ └── apboot.hh │ └── mcconf.module ├── apboot-mp │ ├── boot │ │ ├── apboot.cc │ │ └── apboot.hh │ └── mcconf.module ├── apboot-sfi │ ├── boot │ │ ├── apboot.cc │ │ └── apboot.hh │ └── mcconf.module ├── cxx-globals │ ├── boot │ │ └── cxx-globals.hh │ └── mcconf.module ├── init-loader-amd64 │ ├── boot │ │ ├── CapAlloc.hh │ │ ├── MemMapper.cc │ │ ├── MemMapper.hh │ │ ├── init_image.S │ │ ├── load_init.cc │ │ ├── load_init.hh │ │ └── load_init_plugin.cc │ └── mcconf.module ├── kernel-amd64-ihk │ ├── boot │ │ ├── DeployKernelSpace.hh │ │ ├── IhkSink.hh │ │ ├── boot.ld │ │ ├── bootparam.h │ │ ├── ihk-entry.cc │ │ ├── ihk-entry.hh │ │ ├── init-kernelspace-common.cc │ │ ├── init-kernelspace-common.hh │ │ ├── kmem.cc │ │ ├── kmem.hh │ │ ├── memory-layout-common.h │ │ ├── memory-layout.h │ │ ├── mlog.cc │ │ ├── mlog.hh │ │ ├── pagetables.hh │ │ └── start.S │ ├── mcconf.module │ └── util │ │ └── PhysPtr.hh ├── kernel-amd64-knc │ ├── boot │ │ ├── DeployKernelSpace.cc │ │ ├── DeployKernelSpace.hh │ │ ├── boot.ld │ │ ├── memory-layout.h │ │ ├── mlog.cc │ │ ├── mlog.hh │ │ └── start.S │ └── mcconf.module ├── kernel-amd64-pc │ ├── boot │ │ ├── DeployKernelSpace.hh │ │ ├── boot.ld │ │ ├── memory-layout.h │ │ ├── mlog.cc │ │ ├── mlog.hh │ │ └── start.S │ └── mcconf.module ├── kernel-main │ ├── boot │ │ ├── kernel.cc │ │ └── kernel.hh │ └── mcconf.module ├── kernelspace-amd64 │ ├── boot │ │ ├── init-kernelspace-common.cc │ │ ├── init-kernelspace-common.hh │ │ ├── memory-layout-common.h │ │ ├── pagetables.cc │ │ ├── pagetables.cc.m4 │ │ └── pagetables.hh │ └── mcconf.module ├── kmem-common │ ├── boot │ │ └── kmem-common.hh │ └── mcconf.module ├── kmem-e820 │ ├── boot │ │ ├── kmem.cc │ │ └── kmem.hh │ └── mcconf.module ├── kmem-multiboot │ ├── boot │ │ ├── kmem.cc │ │ └── kmem.hh │ └── mcconf.module ├── kmem-sfi │ ├── boot │ │ ├── kmem.cc │ │ └── kmem.hh │ └── mcconf.module └── memory-root │ ├── boot │ ├── memory-root.cc │ └── memory-root.hh │ └── mcconf.module ├── build ├── cxxabi-kernel │ ├── mcconf.module │ └── util │ │ ├── cxxdelete.cc │ │ ├── cxxsupport.cc │ │ ├── stl │ │ ├── bits │ │ │ ├── std_abs.h │ │ │ └── stdlib-float.h │ │ ├── cstring │ │ ├── stdexcept │ │ └── string │ │ └── string.cc ├── doxygen │ ├── Doxyfile │ ├── doxygen │ │ └── namespaces.dox │ └── mcconf.module ├── emu-bochs-amd64 │ ├── mako_bochs.rc │ └── mcconf.module ├── emu-quemu-amd64 │ └── mcconf.module ├── gcc-host-pc │ ├── mcconf.module │ └── util │ │ └── compiler.hh ├── gcc-kernel-knc │ ├── mcconf.module │ └── util │ │ └── compiler.hh ├── gcc-kernel-pc │ ├── mcconf.module │ └── util │ │ └── compiler.hh ├── gitignore │ ├── .gitignore │ └── mcconf.module └── iso-image │ ├── boot │ └── isodir │ │ └── boot │ │ └── grub │ │ └── grub.cfg │ └── iso-image.module ├── cpu ├── clflush-amd64 │ ├── cpu │ │ └── clflush.hh │ └── mcconf.module ├── clflush-knc │ ├── cpu │ │ └── clflush.hh │ └── mcconf.module ├── core-local-memory │ ├── cpu │ │ ├── CoreLocal.cc │ │ └── CoreLocal.hh │ └── mcconf.module ├── ctrlregs-amd64 │ ├── cpu │ │ ├── ctrlregs.hh │ │ └── fpuregs.hh │ └── mcconf.module ├── fpu-amd64 │ ├── cpu │ │ ├── fpu.cc │ │ └── fpu.hh │ └── mcconf.module ├── hwthreadid │ ├── cpu │ │ ├── hwthreadid.cc │ │ └── hwthreadid.hh │ └── mcconf.module ├── hwthreadpause-amd64 │ ├── cpu │ │ └── hwthread_pause.hh │ └── mcconf.module ├── hwthreadpause-delay │ ├── cpu │ │ └── hwthread_pause.hh │ └── mcconf.module ├── idle-hlt │ ├── cpu │ │ ├── idle.hh │ │ └── idle_lowlevel.S │ └── mcconf.module ├── idle-knc │ ├── cpu │ │ ├── idle.cc │ │ ├── idle.hh │ │ └── idle_lowlevel.S │ └── mcconf.module ├── ioapic-amd64 │ ├── cpu │ │ ├── IOApic.hh │ │ └── IOApicAmd64.cc │ └── mcconf.module ├── ioapic-kncapic │ ├── cpu │ │ ├── IOApic.hh │ │ ├── IOApicKNC.cc │ │ └── sbox.hh │ └── mcconf.module ├── ioapic │ ├── cpu │ │ └── IOApicDef.hh │ └── mcconf.module ├── kernel-bug-amd64 │ ├── cpu │ │ ├── IrqHandler.cc │ │ └── IrqHandler.hh │ └── mcconf.module ├── kernel-entry-amd64 │ ├── cpu │ │ ├── IRQDescriptorAmd64.hh │ │ ├── IRQDescriptorX86.hh │ │ ├── IdtAmd64.cc │ │ ├── IdtAmd64.hh │ │ ├── irq_entry.S │ │ ├── kernel_entry.cc │ │ ├── kernel_entry.hh │ │ ├── syscall_entry.S │ │ └── thread-state-layout.h │ └── mcconf.module ├── lapic-kncapic │ ├── cpu │ │ └── LAPICdef.hh │ └── mcconf.module ├── lapic-xapic │ ├── cpu │ │ └── LAPICdef.hh │ └── mcconf.module ├── lapic │ ├── cpu │ │ ├── LAPIC.cc │ │ └── LAPIC.hh │ └── mcconf.module ├── mlog-serial │ ├── cpu │ │ ├── MLogSinkSerial.cc │ │ └── MLogSinkSerial.hh │ └── mcconf.module ├── performance-monitoring-amd64 │ ├── cpu │ │ ├── perfmon.hh │ │ └── perfmondefs.hh │ └── mcconf.module ├── pic │ ├── cpu │ │ └── PIC.hh │ └── mcconf.module ├── segments-amd64 │ ├── cpu │ │ ├── GdtAmd64.hh │ │ ├── SegmentAccess.hh │ │ ├── SegmentDescriptor.hh │ │ ├── gdt-layout.h │ │ └── tss64.hh │ └── mcconf.module ├── serial-port │ ├── cpu │ │ ├── SerialPort.hh │ │ └── SerialStreamBuf.hh │ └── mcconf.module ├── stacktrace │ ├── cpu │ │ └── stacktrace.hh │ └── mcconf.module └── x2apic │ ├── cpu │ ├── LAPIC.cc │ └── LAPIC.hh │ └── mcconf.module ├── host ├── host-common │ ├── mcconf.module │ └── util │ │ ├── FDReceiver.hh │ │ ├── FDSender.hh │ │ ├── PhysPtr.hh │ │ └── assert.hh ├── init-channel │ ├── host │ │ ├── InitChannel.cc │ │ └── InitChannel.hh │ └── mcconf.module ├── pci-memaccess │ ├── host │ │ ├── IMemMapper.hh │ │ ├── MemAccess.hh │ │ ├── MemMapperPci.cc │ │ └── MemMapperPci.hh │ └── mcconf.module └── xmicterm │ ├── host │ └── xmicterm.cc │ └── mcconf.module ├── mythos ├── caps │ ├── mcconf.module │ └── mythos │ │ └── caps.hh ├── error │ ├── mcconf.module │ └── mythos │ │ └── Error.hh ├── host-info-table-knc │ ├── mcconf.module │ └── mythos │ │ └── HostInfoTable.hh ├── infoFrame │ ├── mcconf.module │ └── mythos │ │ └── InfoFrame.hh ├── init │ ├── mcconf.module │ └── mythos │ │ └── init.hh ├── invocation │ ├── mcconf.module │ └── mythos │ │ ├── InvocationBuf.hh │ │ ├── KEvent.hh │ │ ├── invocation.hh │ │ ├── protocol │ │ ├── CapMap.hh │ │ ├── Example.hh │ │ ├── ExecutionContext.hh │ │ ├── Frame.hh │ │ ├── InterruptControl.hh │ │ ├── KernelMemory.hh │ │ ├── KernelObject.hh │ │ ├── PageMap.hh │ │ ├── Portal.hh │ │ └── common.hh │ │ └── syscall.hh └── pci-mpsc-queue │ ├── mcconf.module │ └── mythos │ └── PciMsgQueueMPSC.hh ├── objects ├── capability-spinning │ ├── mcconf.module │ └── objects │ │ ├── CapEntry.cc │ │ ├── CapEntry.hh │ │ ├── RevokeOperation.cc │ │ └── RevokeOperation.hh ├── capability-utils │ ├── mcconf.module │ └── objects │ │ ├── CapRef.cc │ │ ├── CapRef.hh │ │ ├── DeleteBroadcast.cc │ │ ├── DeleteBroadcast.hh │ │ ├── TypedCap.hh │ │ ├── ops.cc │ │ └── ops.hh ├── capmap │ ├── mcconf.module │ └── objects │ │ ├── CapMap.cc │ │ └── CapMap.hh ├── common │ ├── mcconf.module │ └── objects │ │ ├── Cap.hh │ │ ├── DebugMessage.cc │ │ ├── DebugMessage.hh │ │ ├── IAllocator.hh │ │ ├── ICapMap.hh │ │ ├── IDeleter.hh │ │ ├── IFactory.hh │ │ ├── IFrame.hh │ │ ├── IInvocation.hh │ │ ├── IKernelObject.hh │ │ ├── IPageMap.hh │ │ ├── IPortal.hh │ │ ├── ISchedulable.cc │ │ ├── ISchedulable.hh │ │ ├── IScheduler.hh │ │ ├── ISignalable.hh │ │ ├── kevent.hh │ │ ├── mlog.cc │ │ ├── mlog.hh │ │ └── signal.hh ├── cpudriver-knc │ ├── mcconf.module │ ├── mythos │ │ └── protocol │ │ │ └── CpuDriverKNC.hh │ └── objects │ │ ├── CpuDriverKNC.cc │ │ ├── CpuDriverKNC.hh │ │ └── PluginCpuDriverKNC.cc ├── example │ ├── mcconf.module │ └── objects │ │ ├── Example.cc │ │ └── Example.hh ├── execution-context │ ├── mcconf.module │ └── objects │ │ ├── ExecutionContext.cc │ │ └── ExecutionContext.hh ├── interrupt-control │ ├── mcconf.module │ └── objects │ │ ├── InterruptControl.cc │ │ └── InterruptControl.hh ├── kernel-memory │ ├── mcconf.module │ └── objects │ │ ├── KernelMemory.cc │ │ └── KernelMemory.hh ├── memory-amd64 │ ├── mcconf.module │ └── objects │ │ ├── DeviceMemory.cc │ │ ├── DeviceMemory.hh │ │ ├── FrameDataAmd64.hh │ │ ├── MemoryRegion.cc │ │ ├── MemoryRegion.hh │ │ ├── PML4InvalidationBroadcastAmd64.cc │ │ ├── PML4InvalidationBroadcastAmd64.hh │ │ ├── PageMapAmd64.cc │ │ └── PageMapAmd64.hh ├── portal │ ├── mcconf.module │ └── objects │ │ ├── Portal.cc │ │ └── Portal.hh ├── processor-allocator │ ├── mcconf.module │ ├── mythos │ │ └── protocol │ │ │ └── ProcessorAllocator.hh │ └── objects │ │ ├── PluginProcessorAllocator.cc │ │ ├── PluginProcessorAllocator.hh │ │ ├── ProcessorAllocator.cc │ │ └── ProcessorAllocator.hh ├── rapl-driver-intel │ ├── mcconf.module │ ├── mythos │ │ └── protocol │ │ │ ├── RaplDriverIntel.hh │ │ │ └── RaplVal.hh │ └── objects │ │ ├── PluginRaplDriverIntel.cc │ │ ├── RaplDriverIntel.cc │ │ └── RaplDriverIntel.hh ├── scheduling-context │ ├── mcconf.module │ └── objects │ │ ├── SchedulingContext.cc │ │ └── SchedulingContext.hh └── signal-listener │ ├── mcconf.module │ ├── mythos │ └── protocol │ │ └── SignalListener.hh │ ├── objects │ ├── SignalListener.cc │ └── SignalListener.hh │ └── runtime │ └── SignalListener.hh ├── plugins ├── common │ ├── mcconf.module │ └── plugins │ │ ├── Plugin.cc │ │ ├── Plugin.hh │ │ └── TestPlugin.hh ├── dump-multiboot │ ├── mcconf.module │ └── plugins │ │ └── dump_multiboot.cc ├── invocation-mock │ ├── mcconf.module │ └── plugins │ │ └── InvocationMock.hh ├── test-caps │ ├── mcconf.module │ └── plugins │ │ ├── test-caps.cc │ │ └── test-caps.hh ├── test-mem │ ├── mcconf.module │ └── plugins │ │ ├── test-mem.cc │ │ └── test-mem.hh ├── test-perfmon │ ├── mcconf.module │ └── plugins │ │ ├── test-perfmon.cc │ │ └── test-perfmon.hh └── test-places │ ├── mcconf.module │ └── plugins │ └── test-places.cc ├── runtime ├── async │ ├── mcconf.module │ └── runtime │ │ ├── FutureBase.cc │ │ ├── FutureBase.hh │ │ ├── ISysretHandler.hh │ │ ├── PortalBase.hh │ │ └── Tasklet.hh ├── cga │ ├── mcconf.module │ └── runtime │ │ ├── cgaAttr.hh │ │ ├── cgaChar.hh │ │ ├── cgaScreen.cc │ │ └── cgaScreen.hh ├── crt-init │ ├── mcconf.module │ └── runtime │ │ ├── crtbegin.cc │ │ ├── crtend.S │ │ └── start.S ├── cxx-headers │ ├── mcconf.module │ └── runtime │ │ └── cxx-includes-test.hh ├── cxx │ ├── mcconf.module │ └── runtime │ │ ├── cxxsupport.cc │ │ ├── futex.cc │ │ ├── futex.hh │ │ └── pthread.cc ├── kobject │ ├── mcconf.module │ └── runtime │ │ ├── CapAlloc.hh │ │ ├── CapMap.hh │ │ ├── Example.hh │ │ ├── ExecutionContext.hh │ │ ├── Frame.hh │ │ ├── InterruptControl.hh │ │ ├── KernelMemory.hh │ │ ├── PageMap.hh │ │ ├── Portal.hh │ │ ├── ProcessorAllocator.hh │ │ ├── RaplDriverIntel.hh │ │ └── SimpleCapAlloc.hh ├── memory │ ├── mcconf.module │ └── runtime │ │ ├── SequentialHeap.hh │ │ ├── brk.cc │ │ ├── brk.hh │ │ ├── tls.cc │ │ ├── tls.hh │ │ ├── umem.cc │ │ └── umem.hh ├── mlog │ ├── mcconf.module │ └── runtime │ │ ├── DebugSink.cc │ │ ├── mlog.cc │ │ └── mlog.hh ├── omp │ └── mcconf.module ├── posix-headers │ ├── mcconf.module │ └── runtime │ │ └── posix-includes-test.hh ├── process │ ├── mcconf.module │ └── runtime │ │ └── process.hh └── thread-extra │ ├── mcconf.module │ └── runtime │ └── thread-extra.hh └── util ├── address ├── mcconf.module └── util │ └── PhysPtr.hh ├── alignment ├── mcconf.module └── util │ └── align.hh ├── assert ├── mcconf.module └── util │ ├── assert-user.cc │ ├── assert.cc │ └── assert.hh ├── bitfield ├── mcconf.module └── util │ └── bitfield.hh ├── castable ├── mcconf.module └── util │ └── ICastable.hh ├── datatypes ├── mcconf.module └── util │ ├── BacktrackBuffer.hh │ ├── Range.hh │ ├── RangeSet.hh │ └── VectorMax.hh ├── error-trace ├── mcconf.module └── util │ ├── error-trace.cc │ └── error-trace.hh ├── events ├── mcconf.module └── util │ └── events.hh ├── first-fit-heap-intrusive ├── mcconf.module └── util │ └── FirstFitHeap.hh ├── fnv-1a ├── mcconf.module └── util │ └── hash.hh ├── linked-list ├── mcconf.module └── util │ └── LinkedList.hh ├── mlog-base ├── mcconf.module └── util │ ├── Filter.hh │ ├── ISink.hh │ ├── Logger.cc │ ├── Logger.hh │ ├── TextMsg.hh │ └── TextMsgHelpers.hh ├── optional ├── mcconf.module └── util │ └── optional.hh ├── ostream ├── mcconf.module └── util │ ├── FixedStreamBuf.hh │ ├── MemStreamBuf.hh │ ├── TeeStreamBuf.hh │ ├── ostream.hh │ └── streambuf.hh ├── string ├── mcconf.module └── util │ └── mstring.hh ├── sys-structures ├── mcconf.module └── util │ ├── ACPI.hh │ ├── ACPIApicTopology.cc │ ├── ACPIApicTopology.hh │ ├── E820.hh │ ├── MPApicTopology.hh │ ├── MultiBoot.hh │ ├── SFI.hh │ └── elf64.hh ├── tidex-mutex ├── mcconf.module ├── runtime │ └── Mutex.hh └── util │ ├── ThreadMutex.hh │ └── TidexMutex.hh └── tuple ├── mcconf.module └── util ├── Tuple.hh ├── applyTuple.hh └── integer_sequence.hh /.dockerignore: -------------------------------------------------------------------------------- 1 | **/.classpath 2 | **/.dockerignore 3 | **/.env 4 | **/.git 5 | **/.gitignore 6 | **/.project 7 | **/.settings 8 | **/.toolstarget 9 | **/.vs 10 | **/.vscode 11 | **/*.*proj.user 12 | **/*.dbmdl 13 | **/*.jfm 14 | **/azds.yaml 15 | **/bin 16 | **/charts 17 | **/docker-compose* 18 | **/compose* 19 | **/Dockerfile* 20 | **/node_modules 21 | **/npm-debug.log 22 | **/obj 23 | **/secrets.dev.yaml 24 | **/values.dev.yaml 25 | README.md 26 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "3rdparty/mcconf"] 2 | path = 3rdparty/mcconf 3 | url = http://github.com/ManyThreads/mcconf.git 4 | branch = master 5 | ignore = dirty 6 | [submodule "3rdparty/musl"] 7 | path = 3rdparty/musl 8 | url = https://github.com/ManyThreads/musl-mythos.git 9 | branch = mythos 10 | ignore = dirty 11 | [submodule "3rdparty/ihk"] 12 | path = 3rdparty/ihk 13 | url = https://github.com/ManyThreads/ihk.git 14 | ignore = dirty 15 | -------------------------------------------------------------------------------- /3rdparty/.gitignore: -------------------------------------------------------------------------------- 1 | bochs 2 | bochs-*.tar.gz 3 | libcxxrt 4 | python-libs 5 | cxx-src 6 | cxx-amd64 7 | cxx-knc 8 | 9 | -------------------------------------------------------------------------------- /3rdparty/check-license-mit.txt: -------------------------------------------------------------------------------- 1 | MIT License -- MyThOS: The Many-Threads Operating System 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | SOFTWARE. 20 | -------------------------------------------------------------------------------- /3rdparty/install-bochs: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | function fail { 4 | echo $1 5 | exit 1 6 | } 7 | 8 | command -v curl >/dev/null 2>&1 || fail "require curl but it's not installed." 9 | command -v make >/dev/null 2>&1 || fail "require make but it's not installed" 10 | command -v g++ >/dev/null 2>&1 || fail "require g++ but it's not installed" 11 | 12 | pushd `dirname $0` > /dev/null 13 | 14 | if test ! -e bochs-2.6.9.tar.gz ; then 15 | curl -LO https://kent.dl.sourceforge.net/project/bochs/bochs/2.6.9/bochs-2.6.9.tar.gz || fail 16 | fi 17 | if test ! -e bochs ; then 18 | tar -xzf bochs-2.6.9.tar.gz 19 | mv bochs-2.6.9 bochs 20 | fi 21 | 22 | cd bochs 23 | 24 | ./configure --enable-smp \ 25 | --enable-cpu-level=6 \ 26 | --enable-x86-64 \ 27 | --disable-monitor-mwait \ 28 | --enable-avx \ 29 | --enable-evex \ 30 | --enable-pci \ 31 | --enable-vmx=no \ 32 | --enable-all-optimizations \ 33 | --enable-debugger \ 34 | --enable-disasm \ 35 | --enable-debugger-gui \ 36 | --enable-x86-debugger \ 37 | --enable-iodebug \ 38 | --enable-logging \ 39 | --enable-fpu \ 40 | --disable-3dnow \ 41 | --enable-cdrom \ 42 | --enable-readline \ 43 | --disable-plugins \ 44 | --disable-docbook \ 45 | --with-x --with-x11 --with-term LIBS=-lpthread 46 | make -j`nproc` 47 | 48 | popd > /dev/null 49 | -------------------------------------------------------------------------------- /3rdparty/install-ihk.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" 4 | IHKDIR="${SCRIPTDIR}/ihk" 5 | BUILDDIR="${IHKDIR}/build" 6 | INSTALLDIR="${IHKDIR}/install" 7 | 8 | rm -rf $INSTALLDIR $BUILDDIR 9 | 10 | mkdir -p $BUILDDIR 11 | mkdir -p $INSTALLDIR 12 | 13 | cd $BUILDDIR 14 | cmake \ 15 | -DENABLE_PERF=OFF \ 16 | -DCMAKE_INSTALL_RPATH="${INSTALLDIR}/lib64/:${INSTALLDIR}/lib/" \ 17 | -DCMAKE_INSTALL_PREFIX=${INSTALLDIR} \ 18 | ${IHKDIR} 19 | 20 | make CFLAGS='-DDEBUG_PRINT' install 21 | -------------------------------------------------------------------------------- /3rdparty/irqbalance_mck.in: -------------------------------------------------------------------------------- 1 | # irqbalance is a daemon process that distributes interrupts across 2 | # CPUS on SMP systems. The default is to rebalance once every 10 3 | # seconds. This is the environment file that is specified to systemd via the 4 | # EnvironmentFile key in the service unit file (or via whatever method the init 5 | # system you're using has. 6 | # 7 | # ONESHOT=yes 8 | # after starting, wait for a minute, then look at the interrupt 9 | # load and balance it once; after balancing exit and do not change 10 | # it again. 11 | #IRQBALANCE_ONESHOT= 12 | 13 | # 14 | # IRQBALANCE_BANNED_CPUS 15 | # 64 bit bitmask which allows you to indicate which cpu's should 16 | # be skipped when reblancing irqs. Cpu numbers which have their 17 | # corresponding bits set to one in this mask will not have any 18 | # irq's assigned to them on rebalance 19 | # 20 | IRQBALANCE_BANNED_CPUS=%mask% 21 | 22 | # 23 | # IRQBALANCE_ARGS 24 | # append any args here to the irqbalance daemon as documented in the man page 25 | # 26 | IRQBALANCE_ARGS=--banirq=%banirq% 27 | 28 | 29 | -------------------------------------------------------------------------------- /3rdparty/libcxx-classictable.patch: -------------------------------------------------------------------------------- 1 | --- cxx-src/libcxx/src/locale.cpp 2018-04-04 06:00:14.000000000 +0200 2 | +++ locale_new.cpp 2019-10-29 19:31:15.343224724 +0100 3 | @@ -1030,11 +1030,11 @@ 4 | return low; 5 | } 6 | 7 | -#if defined(__EMSCRIPTEN__) 8 | +//#if defined(__EMSCRIPTEN__) 9 | extern "C" const unsigned short ** __ctype_b_loc(); 10 | extern "C" const int ** __ctype_tolower_loc(); 11 | extern "C" const int ** __ctype_toupper_loc(); 12 | -#endif 13 | +//#endif 14 | 15 | #ifdef _LIBCPP_PROVIDES_DEFAULT_RUNE_TABLE 16 | const ctype::mask* 17 | @@ -1137,13 +1137,16 @@ 18 | return _ctype_ + 1; 19 | #elif defined(_AIX) 20 | return (const unsigned int *)__lc_ctype_ptr->obj->mask; 21 | +//#elif defined(_LIBCPP_HAS_MUSL_LIBC) 22 | #else 23 | + //assume musl 24 | + return (const unsigned long *)*__ctype_b_loc(); 25 | // Platform not supported: abort so the person doing the port knows what to 26 | // fix 27 | -# warning ctype::classic_table() is not implemented 28 | - printf("ctype::classic_table() is not implemented\n"); 29 | - abort(); 30 | - return NULL; 31 | +//# warning ctype::classic_table() is not implemented 32 | + //printf("ctype::classic_table() is not implemented\n"); 33 | + //abort(); 34 | + //return NULL; 35 | #endif 36 | } 37 | #endif 38 | -------------------------------------------------------------------------------- /3rdparty/libcxx-musl-compat.patch: -------------------------------------------------------------------------------- 1 | --- libcxx.orig/include/support/musl/xlocale.h 2019-10-30 18:27:20.070151981 +0100 2 | +++ libcxx/include/support/musl/xlocale.h 2019-10-30 18:27:31.510099685 +0100 3 | @@ -24,16 +24,6 @@ 4 | extern "C" { 5 | #endif 6 | 7 | -static inline long long strtoll_l(const char *nptr, char **endptr, int base, 8 | - locale_t) { 9 | - return strtoll(nptr, endptr, base); 10 | -} 11 | - 12 | -static inline unsigned long long strtoull_l(const char *nptr, char **endptr, 13 | - int base, locale_t) { 14 | - return strtoull(nptr, endptr, base); 15 | -} 16 | - 17 | static inline long long wcstoll_l(const wchar_t *nptr, wchar_t **endptr, 18 | int base, locale_t) { 19 | return wcstoll(nptr, endptr, base); 20 | -------------------------------------------------------------------------------- /3rdparty/libcxx-nolinux.patch: -------------------------------------------------------------------------------- 1 | diff -r -U3 libcxx.orig/src/filesystem/operations.cpp libcxx/src/filesystem/operations.cpp 2 | --- libcxx.orig/src/filesystem/operations.cpp 2018-11-05 15:40:44.157125056 +0100 3 | +++ libcxx/src/filesystem/operations.cpp 2018-11-05 16:00:15.914711055 +0100 4 | @@ -26,16 +26,6 @@ 5 | #include 6 | #include /* values for fchmodat */ 7 | 8 | -#if defined(__linux__) 9 | -#include 10 | -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 33) 11 | -#include 12 | -#define _LIBCPP_USE_SENDFILE 13 | -#endif 14 | -#elif defined(__APPLE__) || __has_include() 15 | -#include 16 | -#define _LIBCPP_USE_COPYFILE 17 | -#endif 18 | 19 | #if !defined(__APPLE__) 20 | #define _LIBCPP_USE_CLOCK_GETTIME 21 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | The MyThOS project was supported by the German Federal Ministry of 2 | Education and Research (BMBF) grant no. 01IH13003C (MyThOS 3 | project). The x86 32bit and gem5 ports were partly supported by the 4 | German Research Foundation (DFG) under grant no. NO 625/7-1 (Coke 5 | project). 6 | 7 | Fabian Fassnacht, Uni Ulm 8 | Maik Krüger, BTU Cottbus-Senftenberg 9 | * interrupt handling 10 | * descriptor tables 11 | 12 | Maximilian Heyne, BTU Cottbus-Senftenberg 13 | * X86-64 memory management 14 | * memory management unit tests 15 | * mcconf compile-time module configuration tool 16 | 17 | Randolf Rotta, BTU Cottbus-Senftenberg 18 | * architecture and design 19 | * communication channels 20 | * basic boot code 21 | 22 | Robert Kuban, BTU Cottbus-Senftenberg 23 | * capabilities: resource inheritance tree 24 | * communication channels 25 | * synchronization primitives 26 | * task scheduling 27 | * testing framework 28 | * error handling 29 | 30 | Stefan Bonfert, Uni Ulm 31 | * benchmarks and debugging 32 | 33 | Tim Naumann, BTU Cottbus-Senftenberg 34 | * X86 port (32bit) 35 | * X86 memory management (32bit) 36 | * clang-based extraction of interface descriptions 37 | * client/server stub generator for remote method invocations 38 | 39 | Vladimir Nikolov, Uni Ulm 40 | * booting all hardware threads 41 | * component models 42 | 43 | Martin Messer, BTU Cottbus-Senftenberg 44 | * gem5 port 45 | * E820 memory table 46 | * various code cleanups 47 | 48 | Zuzana Gabonayova, BTU Cottbus-Senftenberg 49 | * tracing subsystem and trace analysis 50 | 51 | Stefan Hertrampf, BTU Cottbus-Senftenberg 52 | * improved xmicterm 53 | * improved mlog macros and output 54 | * cleanups in various kernel objects 55 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:latest 2 | 3 | ARG DEBIAN_FRONTEND=noninteractive 4 | RUN apt-get -y update &&\ 5 | apt-get -y upgrade &&\ 6 | apt-get -y install build-essential cmake python virtualenv curl git qemu-system-x86 m4 7 | 8 | COPY 3rdparty /usr/src/myapp/3rdparty 9 | WORKDIR /usr/src/myapp 10 | 11 | RUN 3rdparty/mcconf/install-python-libs.sh 12 | RUN 3rdparty/install-libcxx.sh 13 | 14 | COPY arch-config /usr/src/myapp/arch-config 15 | COPY kernel /usr/src/myapp/kernel 16 | COPY kernel-amd64.config /usr/src/myapp/kernel-amd64.config 17 | COPY Makefile.user /usr/src/myapp/Makefile.user 18 | RUN 3rdparty/mcconf/mcconf -i kernel-amd64.config 19 | 20 | WORKDIR /usr/src/myapp/kernel-amd64 21 | RUN make all 22 | 23 | CMD ["make", "qemu"] 24 | 25 | LABEL Name=mythos Version=0.0.1 26 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2016 Brandenburgische Technische Universität Cottbus--Senftenberg 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | 2 | 3 | # targets 4 | 5 | all: 3rdparty/mcconf/mcconf kernel-amd64.log kernel-knc.log host-knc.log kernel-ihk.log 6 | 7 | 3rdparty/mcconf/mcconf: 8 | git submodule update --init --recursive 9 | 3rdparty/mcconf/install-python-libs.sh 10 | 11 | clean: 12 | rm -f *.log 13 | rm -rf kernel-amd64 14 | rm -rf kernel-knc 15 | rm -rf host-knc 16 | rm -rf kernel-ihk 17 | 18 | # rules 19 | 20 | %.log: %.config 21 | ./3rdparty/mcconf/mcconf -i $< 22 | -------------------------------------------------------------------------------- /Makefile.user: -------------------------------------------------------------------------------- 1 | CPPFLAGS+= -DMLOG_APP=FilterAny 2 | CPPFLAGS+= -DMLOG_ASYNC=FilterError 3 | CPPFLAGS+= -DMLOG_BOOT=FilterError 4 | CPPFLAGS+= -DMLOG_CPU=FilterError 5 | CPPFLAGS+= -DMLOG_CAP=FilterError 6 | CPPFLAGS+= -DMLOG_EC=FilterInfo 7 | CPPFLAGS+= -DMLOG_IRQ=FilterError 8 | CPPFLAGS+= -DMLOG_KM=FilterError 9 | CPPFLAGS+= -DMLOG_PORTAL=FilterError 10 | CPPFLAGS+= -DMLOG_SCHED=FilterError 11 | CPPFLAGS+= -DMLOG_SYSCALL=FilterError 12 | CPPFLAGS+= -DMLOG_TASKLET=FilterError 13 | CPPFLAGS+= -DMLOG_PERFMON=FilterAny 14 | CPPFLAGS+= -DMLOG_PROCESSORMGMT=FilterWarning 15 | 16 | #CPPFLAGS+= -DTRACE 17 | #CPPFLAGS+= -DNDEBUG 18 | 19 | # mlog error throw 20 | # 21 | # FilterError shows only where the error is thrown 22 | # FilterWarning shows the error trace, hence, how the error is propagated 23 | # FilterDetail shows an stacktrace were the error is thrown the first time 24 | # FilterAny shows everything 25 | # 26 | # Default is FilterAny, since this is very helpful for finding errors. 27 | # If the stacktrace is to verbose, consider FilterWarning. 28 | # DO NOT COMMIT TO MASTER WITH ERROR TRACE OFF 29 | # 30 | #CPPFLAGS+= -DMLOG_ERROR_THROW=FilterWarning 31 | -------------------------------------------------------------------------------- /arch-config/arch-amd64.module: -------------------------------------------------------------------------------- 1 | # -*- mode:toml; -*- 2 | [module.arch-amd64] 3 | # pseudo modules and so on that are assumed as available 4 | noauto = true 5 | provides = [ 6 | "tag/cpu/amd64", 7 | "tag/cpu/pause", 8 | "tag/cpu/clflush", 9 | "tag/cpu/xapic", 10 | "tag/cpu/amd64ioapic", 11 | "tag/mode/kernel", 12 | "tag/platform/pc", 13 | "tag/compiler/gcc", 14 | "tag/boot/acpi", 15 | "tag/boot/multiboot", 16 | "tag/cap/spinning", 17 | ] 18 | 19 | requires = [ 20 | "boot32.elf", 21 | "tag/emu-qemu", 22 | "tag/emu-bochs", 23 | "Makefile", 24 | ] 25 | -------------------------------------------------------------------------------- /arch-config/arch-ihk.module: -------------------------------------------------------------------------------- 1 | # -*- mode:toml; -*- 2 | [module.arch-ihk] 3 | # pseudo modules and so on that are assumed as available 4 | noauto = true 5 | provides = [ 6 | "tag/cpu/amd64", 7 | "tag/cpu/pause", 8 | "tag/cpu/clflush", 9 | "tag/cpu/x2apic", 10 | "tag/cpu/amd64ioapic", 11 | "tag/mode/kernel", 12 | "tag/platform/pc", 13 | "tag/compiler/gcc", 14 | "tag/boot/ihk", 15 | "tag/boot/multiboot", 16 | "tag/cap/spinning", 17 | ] 18 | 19 | requires = [ 20 | "boot64.elf", 21 | "Makefile", 22 | ] 23 | -------------------------------------------------------------------------------- /arch-config/arch-knc.module: -------------------------------------------------------------------------------- 1 | # -*- mode:toml; -*- 2 | [module.arch-knc] 3 | # pseudo modules and so on that are assumed as available 4 | noauto = true 5 | provides = [ 6 | "tag/cpu/amd64", 7 | "tag/cpu/delay", 8 | "tag/cpu/clevict", 9 | "tag/cpu/kncapic", "tag/cpu/xapic", 10 | "tag/mode/kernel", 11 | "tag/compiler/gcc", 12 | "tag/boot/sfi", 13 | "tag/cap/spinning", 14 | "tag/cpu/kncioapic", 15 | "tag/platform/knc", 16 | ] 17 | 18 | requires = [ 19 | "boot64.elf", 20 | "Makefile", 21 | ] 22 | 23 | modules = [ 24 | "lapic", "lapic-kncapic", 25 | ] 26 | -------------------------------------------------------------------------------- /doc/base-kernel/.gitignore: -------------------------------------------------------------------------------- 1 | main.pdf 2 | fig/vectors 3 | -------------------------------------------------------------------------------- /doc/base-kernel/Makefile: -------------------------------------------------------------------------------- 1 | all: 2 | latexmk -pdf main.tex 3 | 4 | watch: 5 | latexmk -pdf -pvc main.tex 6 | 7 | clean: 8 | latexmk -C make.tex 9 | 10 | release: main.pdf 11 | cp -i main.pdf base-kernel.pdf 12 | -------------------------------------------------------------------------------- /doc/base-kernel/MyThOS_Logo.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManyThreads/mythos/723a4b11e454a0c28e096755140c5e0eecf6a211/doc/base-kernel/MyThOS_Logo.pdf -------------------------------------------------------------------------------- /doc/base-kernel/base-kernel.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManyThreads/mythos/723a4b11e454a0c28e096755140c5e0eecf6a211/doc/base-kernel/base-kernel.pdf -------------------------------------------------------------------------------- /doc/base-kernel/fig/DSC01686.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManyThreads/mythos/723a4b11e454a0c28e096755140c5e0eecf6a211/doc/base-kernel/fig/DSC01686.JPG -------------------------------------------------------------------------------- /doc/base-kernel/fig/DSC01687.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManyThreads/mythos/723a4b11e454a0c28e096755140c5e0eecf6a211/doc/base-kernel/fig/DSC01687.JPG -------------------------------------------------------------------------------- /doc/base-kernel/fig/DSC01705.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManyThreads/mythos/723a4b11e454a0c28e096755140c5e0eecf6a211/doc/base-kernel/fig/DSC01705.JPG -------------------------------------------------------------------------------- /doc/base-kernel/fig/DerivedReferenceBits.dia: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManyThreads/mythos/723a4b11e454a0c28e096755140c5e0eecf6a211/doc/base-kernel/fig/DerivedReferenceBits.dia -------------------------------------------------------------------------------- /doc/base-kernel/fig/DerivedReferenceBits.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManyThreads/mythos/723a4b11e454a0c28e096755140c5e0eecf6a211/doc/base-kernel/fig/DerivedReferenceBits.pdf -------------------------------------------------------------------------------- /doc/base-kernel/fig/ExecutionContext.dia: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManyThreads/mythos/723a4b11e454a0c28e096755140c5e0eecf6a211/doc/base-kernel/fig/ExecutionContext.dia -------------------------------------------------------------------------------- /doc/base-kernel/fig/ExecutionContext.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManyThreads/mythos/723a4b11e454a0c28e096755140c5e0eecf6a211/doc/base-kernel/fig/ExecutionContext.pdf -------------------------------------------------------------------------------- /doc/base-kernel/fig/KernelObject.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManyThreads/mythos/723a4b11e454a0c28e096755140c5e0eecf6a211/doc/base-kernel/fig/KernelObject.pdf -------------------------------------------------------------------------------- /doc/base-kernel/fig/KernelObject.tex: -------------------------------------------------------------------------------- 1 | 2 | \usetikzlibrary{positioning,arrows,decorations,shapes,decorations.pathmorphing,decorations.pathreplacing} 3 | \begin{tikzpicture} [font=\normalsize] 4 | \newcommand{\pAtt}[1]{ \attribute{+ #1}}; 5 | \newcommand{\pOp}[1]{\operation{+ #1}}; 6 | 7 | \begin{class}[text width = 6cm]{KernelObject}{0,0} 8 | \operation{process ( Capability* , Msg * ) }; 9 | \operation{ revoke ( Capability* ) }; 10 | \end{class} 11 | 12 | \begin{class}[text width = 6cm] {ExecutionContext} {0,-3} 13 | \inherit{KernelObject}; 14 | \end{class} 15 | 16 | \begin{class}[text width = 6cm] {Capability} { -12,0} 17 | \operation{ invoke ( Msg * ) }; 18 | \operation{ revoke() }; 19 | \end{class} 20 | 21 | % other dependencies 22 | \aggregation{Capability.north east}{*..1}{Object}{KernelObject.north west} 23 | \composition{KernelObject} {*..1}{owned Capabilities}{Capability} 24 | \aggregation{Capability.south east}{*..1}{Subject}{KernelObject.south west} 25 | \draw[umlcd style, open diamond->] (Capability.north west) ++ (0.5,0) -- ++(0,1)-- ++(-1,0) |- ++(0,-1)-- (Capability.north west) 26 | node [, yshift = 1 cm ,above]{parent} 27 | node [above]{1..*}; 28 | \draw[umlcd style, open diamond->] (Capability.south west) ++ (0.5,0) -- ++(0,-1)-- ++(-1,0) |- ++(0,1)-- (Capability.south west) 29 | node [, yshift = -1 cm ,below]{children} 30 | node [above ,yshift =-0.5cm ]{*..1}; 31 | 32 | \end{tikzpicture} -------------------------------------------------------------------------------- /doc/base-kernel/fig/Makefile: -------------------------------------------------------------------------------- 1 | # files 2 | 3 | VECTOR_FILES := \ 4 | $(patsubst %.svg,%.pdf,$(shell find . -type f -name '*.svg')) \ 5 | $(patsubst %.dia,%.pdf,$(shell find . -type f -name '*.dia')) 6 | 7 | # patterns 8 | 9 | %.pdf : %.svg 10 | inkscape --without-gui "$<" --export-pdf="$@" 11 | 12 | %.svg : %.dia 13 | dia --filter=svg --export="$@" "$<" 14 | 15 | # targets 16 | 17 | vectors: $(VECTOR_FILES) 18 | echo $(sort $(VECTOR_FILES)) > vectors 19 | 20 | clean: vectors 21 | rm `cat vectors` 22 | rm vectors 23 | -------------------------------------------------------------------------------- /doc/base-kernel/fig/cap-tree.dia: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManyThreads/mythos/723a4b11e454a0c28e096755140c5e0eecf6a211/doc/base-kernel/fig/cap-tree.dia -------------------------------------------------------------------------------- /doc/base-kernel/fig/cap-tree.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManyThreads/mythos/723a4b11e454a0c28e096755140c5e0eecf6a211/doc/base-kernel/fig/cap-tree.pdf -------------------------------------------------------------------------------- /doc/base-kernel/fig/capability-model.dia: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManyThreads/mythos/723a4b11e454a0c28e096755140c5e0eecf6a211/doc/base-kernel/fig/capability-model.dia -------------------------------------------------------------------------------- /doc/base-kernel/fig/capability-model.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManyThreads/mythos/723a4b11e454a0c28e096755140c5e0eecf6a211/doc/base-kernel/fig/capability-model.pdf -------------------------------------------------------------------------------- /doc/base-kernel/fig/capability-states.dia: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManyThreads/mythos/723a4b11e454a0c28e096755140c5e0eecf6a211/doc/base-kernel/fig/capability-states.dia -------------------------------------------------------------------------------- /doc/base-kernel/fig/capability-states.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManyThreads/mythos/723a4b11e454a0c28e096755140c5e0eecf6a211/doc/base-kernel/fig/capability-states.pdf -------------------------------------------------------------------------------- /doc/base-kernel/fig/entry.dia: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManyThreads/mythos/723a4b11e454a0c28e096755140c5e0eecf6a211/doc/base-kernel/fig/entry.dia -------------------------------------------------------------------------------- /doc/base-kernel/fig/entry.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManyThreads/mythos/723a4b11e454a0c28e096755140c5e0eecf6a211/doc/base-kernel/fig/entry.pdf -------------------------------------------------------------------------------- /doc/base-kernel/fig/error-propagation.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManyThreads/mythos/723a4b11e454a0c28e096755140c5e0eecf6a211/doc/base-kernel/fig/error-propagation.pdf -------------------------------------------------------------------------------- /doc/base-kernel/fig/kernel-object-cap.dia: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManyThreads/mythos/723a4b11e454a0c28e096755140c5e0eecf6a211/doc/base-kernel/fig/kernel-object-cap.dia -------------------------------------------------------------------------------- /doc/base-kernel/fig/kernel-object-cap.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManyThreads/mythos/723a4b11e454a0c28e096755140c5e0eecf6a211/doc/base-kernel/fig/kernel-object-cap.pdf -------------------------------------------------------------------------------- /doc/base-kernel/fig/kernel-objects-logical.dia: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManyThreads/mythos/723a4b11e454a0c28e096755140c5e0eecf6a211/doc/base-kernel/fig/kernel-objects-logical.dia -------------------------------------------------------------------------------- /doc/base-kernel/fig/kernel-objects-logical.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManyThreads/mythos/723a4b11e454a0c28e096755140c5e0eecf6a211/doc/base-kernel/fig/kernel-objects-logical.pdf -------------------------------------------------------------------------------- /doc/base-kernel/fig/mcconf.dia: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManyThreads/mythos/723a4b11e454a0c28e096755140c5e0eecf6a211/doc/base-kernel/fig/mcconf.dia -------------------------------------------------------------------------------- /doc/base-kernel/fig/mcconf.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManyThreads/mythos/723a4b11e454a0c28e096755140c5e0eecf6a211/doc/base-kernel/fig/mcconf.pdf -------------------------------------------------------------------------------- /doc/base-kernel/fig/portal.dia: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManyThreads/mythos/723a4b11e454a0c28e096755140c5e0eecf6a211/doc/base-kernel/fig/portal.dia -------------------------------------------------------------------------------- /doc/base-kernel/fig/portal.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManyThreads/mythos/723a4b11e454a0c28e096755140c5e0eecf6a211/doc/base-kernel/fig/portal.pdf -------------------------------------------------------------------------------- /doc/base-kernel/fig/recdepth.dia: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManyThreads/mythos/723a4b11e454a0c28e096755140c5e0eecf6a211/doc/base-kernel/fig/recdepth.dia -------------------------------------------------------------------------------- /doc/base-kernel/fig/recdepth.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManyThreads/mythos/723a4b11e454a0c28e096755140c5e0eecf6a211/doc/base-kernel/fig/recdepth.pdf -------------------------------------------------------------------------------- /doc/base-kernel/fig/tasklet-class.dia: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManyThreads/mythos/723a4b11e454a0c28e096755140c5e0eecf6a211/doc/base-kernel/fig/tasklet-class.dia -------------------------------------------------------------------------------- /doc/base-kernel/fig/tasklet-class.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManyThreads/mythos/723a4b11e454a0c28e096755140c5e0eecf6a211/doc/base-kernel/fig/tasklet-class.pdf -------------------------------------------------------------------------------- /doc/base-kernel/fig/template_ba.pgs: -------------------------------------------------------------------------------- 1 | \documentclass{article} 2 | \usepackage{mathptmx} 3 | \usepackage{tikz} 4 | \usepackage{pgf-umlsd} 5 | \usepackage{pgf-umlcd} 6 | \usepackage{csvsimple} 7 | \usepackage{filecontents} 8 | \renewcommand{\umltextcolor}{black} 9 | \renewcommand{\umldrawcolor}{black} 10 | \renewcommand{\umlfillcolor}{white} 11 | %\usepackage{color} 12 | \usepackage[active,pdftex,tightpage]{preview} 13 | \PreviewEnvironment[]{tikzpicture} 14 | \PreviewEnvironment[]{pgfpicture} 15 | \DeclareSymbolFont{symbolsb}{OMS}{cmsy}{m}{n} 16 | \SetSymbolFont{symbolsb}{bold}{OMS}{cmsy}{b}{n} 17 | \DeclareSymbolFontAlphabet{\mathcal}{symbolsb} 18 | \begin{document} 19 | <> 20 | \end{document} 21 | -------------------------------------------------------------------------------- /doc/base-kernel/kernelsched.tex: -------------------------------------------------------------------------------- 1 | \chapter{Kernel-Level Scheduling and Concurrency Control} 2 | \label{chapter:kernel-scheduling} 3 | 4 | -------------------------------------------------------------------------------- /doc/base-kernel/slides/Makefile: -------------------------------------------------------------------------------- 1 | all: 2 | latexmk -pdf main.tex 3 | 4 | clean: 5 | latexmk -C make.tex 6 | -------------------------------------------------------------------------------- /doc/base-kernel/slides/beamercolorthemebtu.sty: -------------------------------------------------------------------------------- 1 | % Beamer theme by Jana Traue 2 | % December 2010 version 0.1 3 | % 4 | % based on the LaTeX-Beamer package : 5 | % Copyright 2003 by Till Tantau 6 | % 7 | % This program can be redistributed and/or modified under the terms 8 | % of the GNU Public License, version 2. 9 | % 10 | \mode 11 | % 12 | \definecolor{beamer@btublack}{cmyk}{0.1,0,0,0.8} 13 | \definecolor{beamer@btured}{cmyk}{0,1,0.9,0} 14 | \definecolor{beamer@fak1Color}{cmyk}{0.10,1.00,0,0} % magenta 15 | \definecolor{beamer@fak2Color}{cmyk}{1,0.70,0,0} % dark blue 16 | \definecolor{beamer@fak3Color}{cmyk}{1,0,0.10,0} % light blue 17 | \definecolor{beamer@fak4Color}{cmyk}{0.45,0,1,0} % light green 18 | % 19 | \definecolor{beamer@highlightColor}{named}{black} 20 | % 21 | \setbeamercolor{structure}{fg=beamer@highlightColor} 22 | % 23 | \setbeamercolor{title}{parent=normal} 24 | % 25 | \setbeamercolor{section in toc}{parent=structure} 26 | \setbeamercolor{section in toc shaded}{parent=normal} 27 | % 28 | \setbeamercolor{section number projected}{parent=item projected} 29 | % 30 | \setbeamercolor{subsection in toc}{parent=section in toc} 31 | \setbeamercolor{subsection in toc shaded}{parent=normal} 32 | % 33 | \setbeamercolor{footline}{fg=beamer@highlightColor} 34 | % 35 | \setbeamercolor{item}{parent=normal} 36 | \setbeamercolor{alerted text}{fg=beamer@fak1Color} 37 | \setbeamercolor{example text}{fg=beamer@fak4Color} 38 | % 39 | \setbeamercolor{mini frame}{parent=section in toc} 40 | %\setbeamercolor{mini frame shaded}{parent=beamer@fak4Color} 41 | \setbeamercolor{mini frame shaded}{use=normal text,fg=normal text.fg!30!bg} 42 | % 43 | \mode 44 | 45 | -------------------------------------------------------------------------------- /doc/base-kernel/slides/beamercolorthemefak1.sty: -------------------------------------------------------------------------------- 1 | % Beamer theme by Jana Traue 2 | % December 2010 version 0.1 3 | % 4 | % based on the LaTeX-Beamer package : 5 | % Copyright 2003 by Till Tantau 6 | % 7 | % This program can be redistributed and/or modified under the terms 8 | % of the GNU Public License, version 2. 9 | % 10 | \mode 11 | % 12 | \definecolor{beamer@highlightColor}{named}{beamer@fak1Color} 13 | % 14 | \mode 15 | 16 | -------------------------------------------------------------------------------- /doc/base-kernel/slides/beamerfontthemebtu.sty: -------------------------------------------------------------------------------- 1 | % Beamer theme by Jana Traue 2 | % December 2010 version 0.1 3 | % 4 | % based on the LaTeX-Beamer package : 5 | % Copyright 2003 by Till Tantau 6 | % 7 | % This program can be redistributed and/or modified under the terms 8 | % of the GNU Public License, version 2. 9 | % 10 | \mode 11 | % 12 | \setbeamerfont{title}{parent=structure,size=\normalsize,series=\bfseries} 13 | \setbeamerfont{subtitle}{parent=title, size=\normalsize,series=\mdseries} 14 | % 15 | \setbeamerfont{author}{parent=normal, size=\footnotesize} 16 | \setbeamerfont{date}{parent=normal, size=\scriptsize} 17 | % 18 | \setbeamerfont{section in toc}{parent=title} 19 | % 20 | \setbeamerfont{frametitle}{parent=structure,size=\normalsize,series=\bfseries} 21 | \setbeamerfont{framesubtitle}{parent=frametitle,size=\footnotesize} 22 | % 23 | \setbeamerfont{description item}{parent=item, series=\bfseries} 24 | % 25 | \mode 26 | 27 | -------------------------------------------------------------------------------- /doc/base-kernel/slides/beamerinnerthemebtu.sty: -------------------------------------------------------------------------------- 1 | % Beamer theme by Jana Traue 2 | % December 2010 version 0.1 3 | % 4 | % based on the LaTeX-Beamer package : 5 | % Copyright 2003 by Till Tantau 6 | % 7 | % This program can be redistributed and/or modified under the terms 8 | % of the GNU Public License, version 2. 9 | % 10 | \mode 11 | % 12 | \defbeamertemplate*{section in toc}{btu} 13 | {\inserttocsectionnumber. \inserttocsection\par} 14 | 15 | % template definition for arrows in an itemize environment 16 | % 17 | \defbeamertemplate*{itemize item}{btu_arrow}{\put(-7,.25){$\pmb{\Rightarrow}$}} 18 | % 19 | \defbeamertemplate*{itemize subitem}{btu_arrow}{\put(-7,.25){$\Rightarrow$}} 20 | % 21 | \defbeamertemplate*{itemize subsubitem}{btu_arrow}{\put(-7,.25){$\rightarrow$}} 22 | % 23 | % template definition for bullets in an itemize environment 24 | % 25 | \defbeamertemplate*{itemize item}{btu_circle}{\put(0.0,2.5){\circle*{2.5}}} 26 | % 27 | \defbeamertemplate*{itemize subitem}{btu_circle}{\put(0.0,1.75){\circle{2.5}}} 28 | % 29 | \defbeamertemplate*{itemize subsubitem}{btu_circle}{\put(0.0,1.75){\circle{1.5}}} 30 | % 31 | % template definition for rules in an itemize environment 32 | % 33 | \defbeamertemplate*{itemize item}{btu}{\rule[0.2em]{3pt}{1pt}} 34 | % 35 | \defbeamertemplate*{itemize subitem}{btu}{\rule[0.2em]{2pt}{1pt}} 36 | % 37 | \defbeamertemplate*{itemize subsubitem}{btu}{\rule[0.2em]{1pt}{1pt}} 38 | % 39 | \mode 40 | 41 | -------------------------------------------------------------------------------- /doc/base-kernel/slides/figures/3-3-a.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManyThreads/mythos/723a4b11e454a0c28e096755140c5e0eecf6a211/doc/base-kernel/slides/figures/3-3-a.jpg -------------------------------------------------------------------------------- /doc/base-kernel/slides/figures/Makefile: -------------------------------------------------------------------------------- 1 | # files 2 | 3 | VECTOR_FILES := \ 4 | $(patsubst %.svg,%.pdf,$(shell find . -type f -name '*.svg')) \ 5 | $(patsubst %.dia,%.pdf,$(shell find . -type f -name '*.dia')) 6 | 7 | CUSTOM_TARGETS := manycore.pdf 8 | 9 | # patterns 10 | 11 | %.pdf : %.svg 12 | inkscape --without-gui "$<" --export-pdf="$@" 13 | 14 | %.svg : %.dia 15 | dia --filter=svg --export="$@" "$<" 16 | 17 | # targets 18 | 19 | vectors: $(VECTOR_FILES) $(CUSTOM_TARGETS) 20 | # echo $(sort $(VECTOR_FILES)) > vectors 21 | 22 | # custom targets 23 | 24 | manycore.pdf: manycore.R manycore.csv 25 | Rscript manycore.R 26 | -------------------------------------------------------------------------------- /doc/base-kernel/slides/figures/asyncobj.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManyThreads/mythos/723a4b11e454a0c28e096755140c5e0eecf6a211/doc/base-kernel/slides/figures/asyncobj.pdf -------------------------------------------------------------------------------- /doc/base-kernel/slides/figures/cap-tree.dia: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManyThreads/mythos/723a4b11e454a0c28e096755140c5e0eecf6a211/doc/base-kernel/slides/figures/cap-tree.dia -------------------------------------------------------------------------------- /doc/base-kernel/slides/figures/cap-tree.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManyThreads/mythos/723a4b11e454a0c28e096755140c5e0eecf6a211/doc/base-kernel/slides/figures/cap-tree.pdf -------------------------------------------------------------------------------- /doc/base-kernel/slides/figures/continuations.dia: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManyThreads/mythos/723a4b11e454a0c28e096755140c5e0eecf6a211/doc/base-kernel/slides/figures/continuations.dia -------------------------------------------------------------------------------- /doc/base-kernel/slides/figures/continuations.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManyThreads/mythos/723a4b11e454a0c28e096755140c5e0eecf6a211/doc/base-kernel/slides/figures/continuations.pdf -------------------------------------------------------------------------------- /doc/base-kernel/slides/figures/hw-xeonphi-host.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManyThreads/mythos/723a4b11e454a0c28e096755140c5e0eecf6a211/doc/base-kernel/slides/figures/hw-xeonphi-host.pdf -------------------------------------------------------------------------------- /doc/base-kernel/slides/figures/hw-xeonphi.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManyThreads/mythos/723a4b11e454a0c28e096755140c5e0eecf6a211/doc/base-kernel/slides/figures/hw-xeonphi.pdf -------------------------------------------------------------------------------- /doc/base-kernel/slides/figures/layers.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManyThreads/mythos/723a4b11e454a0c28e096755140c5e0eecf6a211/doc/base-kernel/slides/figures/layers.pdf -------------------------------------------------------------------------------- /doc/base-kernel/slides/figures/manycore.R: -------------------------------------------------------------------------------- 1 | data <- read.csv("manycore.csv") 2 | library(ggplot2) 3 | 4 | ## ggplot(data, aes(x=threads,y=fpus,shape=precision,color=precision,label=name)) + geom_point(size=4) + geom_text(hjust=0, vjust=0, show_guide=FALSE) + xlab("max. concurrent control flows") + ylab("scalar floating point units") + xlim(0,1250) + ylim(0,3100) 5 | ## ggsave("manycore.pdf",width=7,height=3) 6 | 7 | data <- subset(data, precision=="DP") 8 | p <- ggplot(data, aes(x=threads,y=fpus,label=name)) + geom_point(size=4, alpha=0.6) + geom_text(hjust=0, vjust=0, show_guide=FALSE) + xlab("max. concurrent control flows") + ylab("double prec. FPUs") + scale_x_log10(breaks=unique(data$threads), limits=c(16,2300)) + scale_y_log10(breaks=unique(data$fpus), limits=c(16,1400)) 9 | ggsave("manycore.pdf", p,width=7,height=3) 10 | -------------------------------------------------------------------------------- /doc/base-kernel/slides/figures/manycore.csv: -------------------------------------------------------------------------------- 1 | name,precision,fpus,threads 2 | Haswell,DP,32,16 3 | Haswell,SP,64,16 4 | Sparc T5,DP,16,128 5 | Cyclops64,DP,80,160 6 | Intel KNC,DP,480,240 7 | Intel KNC,SP,960,240 8 | Intel KNL,DP,1152,288 9 | Intel KNL,SP,2304,288 10 | Fermi GF104,SP,512,768 11 | Fermi GF104,DP,256,768 12 | Kepler GK110,DP,960,960 13 | Kepler GK110,SP,2880,960 14 | Kalray MPPA,SP,256,256 15 | TileGx72,DP,216,72 16 | -------------------------------------------------------------------------------- /doc/base-kernel/slides/figures/manycore.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManyThreads/mythos/723a4b11e454a0c28e096755140c5e0eecf6a211/doc/base-kernel/slides/figures/manycore.pdf -------------------------------------------------------------------------------- /doc/base-kernel/slides/figures/mem-balancing.dia: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManyThreads/mythos/723a4b11e454a0c28e096755140c5e0eecf6a211/doc/base-kernel/slides/figures/mem-balancing.dia -------------------------------------------------------------------------------- /doc/base-kernel/slides/figures/mem-balancing.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManyThreads/mythos/723a4b11e454a0c28e096755140c5e0eecf6a211/doc/base-kernel/slides/figures/mem-balancing.pdf -------------------------------------------------------------------------------- /doc/base-kernel/slides/figures/syscall-kernel-obj.dia: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManyThreads/mythos/723a4b11e454a0c28e096755140c5e0eecf6a211/doc/base-kernel/slides/figures/syscall-kernel-obj.dia -------------------------------------------------------------------------------- /doc/base-kernel/slides/figures/syscall-kernel-obj.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManyThreads/mythos/723a4b11e454a0c28e096755140c5e0eecf6a211/doc/base-kernel/slides/figures/syscall-kernel-obj.pdf -------------------------------------------------------------------------------- /doc/base-kernel/slides/figures/syscall-stub.dia: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManyThreads/mythos/723a4b11e454a0c28e096755140c5e0eecf6a211/doc/base-kernel/slides/figures/syscall-stub.dia -------------------------------------------------------------------------------- /doc/base-kernel/slides/figures/syscall-stub.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManyThreads/mythos/723a4b11e454a0c28e096755140c5e0eecf6a211/doc/base-kernel/slides/figures/syscall-stub.pdf -------------------------------------------------------------------------------- /doc/base-kernel/slides/figures/syscall.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManyThreads/mythos/723a4b11e454a0c28e096755140c5e0eecf6a211/doc/base-kernel/slides/figures/syscall.pdf -------------------------------------------------------------------------------- /doc/base-kernel/slides/figures/tasklet-class.dia: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManyThreads/mythos/723a4b11e454a0c28e096755140c5e0eecf6a211/doc/base-kernel/slides/figures/tasklet-class.dia -------------------------------------------------------------------------------- /doc/base-kernel/slides/figures/tasklet-class.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManyThreads/mythos/723a4b11e454a0c28e096755140c5e0eecf6a211/doc/base-kernel/slides/figures/tasklet-class.pdf -------------------------------------------------------------------------------- /doc/base-kernel/slides/figures/triangle.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManyThreads/mythos/723a4b11e454a0c28e096755140c5e0eecf6a211/doc/base-kernel/slides/figures/triangle.pdf -------------------------------------------------------------------------------- /doc/base-kernel/slides/figures/um-ops.dia: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManyThreads/mythos/723a4b11e454a0c28e096755140c5e0eecf6a211/doc/base-kernel/slides/figures/um-ops.dia -------------------------------------------------------------------------------- /doc/base-kernel/slides/figures/um-ops.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManyThreads/mythos/723a4b11e454a0c28e096755140c5e0eecf6a211/doc/base-kernel/slides/figures/um-ops.pdf -------------------------------------------------------------------------------- /doc/base-kernel/slides/highlighter.sty: -------------------------------------------------------------------------------- 1 | \RequirePackage{atbegshi} 2 | \RequirePackage{forloop} 3 | \RequirePackage{ifthen} 4 | \RequirePackage{tikz} 5 | \RequirePackage{zref-abspage} 6 | \RequirePackage{zref-abspos} 7 | 8 | % customizable by package user 9 | \tikzset{highlighter/.style = {yellow, line width = \baselineskip}} 10 | 11 | % anchor placement, with @highlight counting upward to generate unique names 12 | \newcounter{@highlight} 13 | \newcommand{\@HighlightAnchor}[1]{\ensuremath{\vcenter{\zsavepos{highlight-#1}}}} 14 | \newcommand{\HighlightFrom}[0]{\stepcounter{@highlight}\@HighlightAnchor{begin-\the@highlight}} 15 | \newcommand{\HighlightTo}[0]{\@HighlightAnchor{end-\the@highlight}} 16 | 17 | % highlight painting, with @@highlight counting upward to consider all defined highlights 18 | \newcounter{@@highlight} 19 | \newcommand{\@HighlightPage}[1]{\zref@extract{highlight-#1-\the@@highlight}{abspage}} 20 | \newcommand{\@HighlightCoords}[2]{(#1\zposx{highlight-#2-\the@@highlight}sp, #1\zposy{highlight-#2-\the@@highlight}sp)} 21 | 22 | \AtBeginShipout{ 23 | \AtBeginShipoutUpperLeft{ 24 | % consider every highlight until reaching one that is undefined 25 | \forloop{@@highlight}{1}{\@HighlightPage{begin} > 0}{ 26 | % page highlight if it begins and ends on the current page 27 | \ifthenelse{\@HighlightPage{begin} = \value{abspage}}{ 28 | \ifthenelse{\@HighlightPage{end} = \value{abspage}}{ 29 | % drop an anchor here so we compute the proper (x, y) offsets 30 | \zsavepos{highlight-draw-\the@@highlight}% 31 | \tikz[overlay, shift={\@HighlightCoords{-}{draw}}]{ 32 | \draw [highlighter] \@HighlightCoords{}{begin} -- \@HighlightCoords{}{end}; 33 | }} 34 | {\PackageWarning{highlighter}{highlight \protect#\the@@highlight\space crosses from page \@HighlightPage{begin} to page \@HighlightPage{end}}}} 35 | {}}}} -------------------------------------------------------------------------------- /doc/base-kernel/slides/mythos-logo.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManyThreads/mythos/723a4b11e454a0c28e096755140c5e0eecf6a211/doc/base-kernel/slides/mythos-logo.pdf -------------------------------------------------------------------------------- /doc/base-kernel/tasklet-demo/.gitignore: -------------------------------------------------------------------------------- 1 | main 2 | *.o 3 | -------------------------------------------------------------------------------- /doc/base-kernel/tasklet-demo/Makefile: -------------------------------------------------------------------------------- 1 | CXXFLAGS += -Wall -std=c++11 2 | LDFLAGS += -pthread 3 | 4 | all: clean main 5 | 6 | main: main.o 7 | $(CXX) $(CXXFLAGS) $(LDFLAGS) -o main main.o 8 | 9 | clean: 10 | rm -f main.o main 11 | -------------------------------------------------------------------------------- /doc/base-kernel/tasklet-demo/Tasklet.h: -------------------------------------------------------------------------------- 1 | /* -*- mode:C++; -*- */ 2 | #pragma once 3 | 4 | #include 5 | #include 6 | 7 | /** Base class for dummy Tasklet objects, which are sometimes needed for queue management. */ 8 | class TaskletBase 9 | { 10 | public: 11 | std::atomic nextTasklet; 12 | }; 13 | 14 | /** Actual Tasklet implementation. All users of Tasklets expect at least this size of one cacheline. */ 15 | // should be "class alignas(64) Tasklet", but emacs code formatting gets confused :( 16 | class alignas(64) Tasklet 17 | : public TaskletBase 18 | { 19 | public: 20 | enum Consts { CLSIZE = 64 }; 21 | typedef void(*FunPtr)(Tasklet*); 22 | 23 | Tasklet() : handler(nullptr) {} 24 | 25 | void run() { handler(this); } 26 | 27 | template 28 | Tasklet* set(FUNCTOR fun) { 29 | static_assert(sizeof(FUNCTOR) <= sizeof(payload), "tasklet payload is too big"); 30 | new(payload) FUNCTOR(fun); // copy-construct 31 | this->handler = &wrapper; 32 | return this; 33 | } 34 | 35 | // safer to return per copy (MSG without const&) compiler will optimize anyway! 36 | template 37 | MSG get() { 38 | static_assert(sizeof(MSG) <= sizeof(payload), "tasklet payload is too big"); 39 | return *reinterpret_cast(payload); 40 | } 41 | 42 | protected: 43 | template 44 | static void wrapper(Tasklet* msg) { msg->get()(msg); } 45 | 46 | private: 47 | FunPtr handler; 48 | char payload[CLSIZE - sizeof(TaskletBase) - sizeof(handler)]; 49 | }; 50 | -------------------------------------------------------------------------------- /doc/deliverables/.gitignore: -------------------------------------------------------------------------------- 1 | fig/vectors 2 | 3 | D2_2_Gesamtarchitektur.pdf 4 | D2_3_Architekturplan.pdf 5 | D3_2_Finaler_Prototyp.pdf 6 | D3_3_Entwicklungsplan.pdf 7 | D4_2_Developer_Tools.pdf 8 | D4_2_2_Developer_Tools.pdf 9 | D4_3_Developer_Cookbook.pdf 10 | -------------------------------------------------------------------------------- /doc/deliverables/D3_2_Finaler_Prototyp.tex: -------------------------------------------------------------------------------- 1 | \input{header} 2 | 3 | \title{MyThOS D3.2 Finaler Prototyp} 4 | \author{Stefan Bonfert, Vladimir Nikolov, Robert Kuban, Randolf Rotta} 5 | 6 | \hypersetup{ 7 | pdftitle={MyThOS D3.2 Finaler Prototyp}, 8 | pdfsubject={MyThOS Deliverable}, 9 | pdfauthor={Stefan Bonfert, Vladimir Nikolov, Robert Kuban, Randolf Rotta}, 10 | pdfkeywords={MyThOS} % comma separated 11 | } 12 | 13 | \begin{document} 14 | \selectlanguage{ngerman} 15 | \maketitle 16 | 17 | \begin{abstract} 18 | Der finale Prototyp ist das primäre Softwaredeliverable des Arbeitspaketes und integriert die einzelnen Softwareergebnisse und bildet auch die Basis für die folgende Evaluierung. Eine lauffähige Version des Kernels wurde projektintern für Benchmarks bereitgestellt. Diese ist aber äußerst fragil und daher nicht wirklich für Außenstehende benutzbar. Die BTU hat den Betriebssystemkernel seitdem kräftig überarbeitet und will eine stabile Version für Dritte und Folgeprojekte veröffentlichen. 19 | \end{abstract} 20 | 21 | \newpage 22 | \tableofcontents 23 | % --- content ------------------------------------------------------------------ 24 | 25 | \section{Übersicht} 26 | 27 | 28 | % ------------------------------------------------------------------------------ 29 | % \bibliographystyle{alpha} 30 | % \bibliography{literature} 31 | 32 | \end{document} 33 | -------------------------------------------------------------------------------- /doc/deliverables/Makefile: -------------------------------------------------------------------------------- 1 | DOCS = \ 2 | D2_2_Gesamtarchitektur.tex \ 3 | D2_3_Architekturplan.tex \ 4 | D3_2_Finaler_Prototyp.tex \ 5 | D3_3_Entwicklungsplan.tex \ 6 | D4_2_2_Developer_Tools.tex \ 7 | D4_3_Developer_Cookbook.tex \ 8 | D5_2_Infrastruktur_Evaluierung.tex 9 | 10 | all: $(patsubst %.tex,%.pdf,$(DOCS)) 11 | 12 | %.pdf: %.tex header.tex literature.bib fig/*.pdf 13 | latexmk -pdf $*.tex 14 | 15 | clean: 16 | latexmk -C $(DOCS) 17 | -------------------------------------------------------------------------------- /doc/deliverables/MyThOS_Logo.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManyThreads/mythos/723a4b11e454a0c28e096755140c5e0eecf6a211/doc/deliverables/MyThOS_Logo.pdf -------------------------------------------------------------------------------- /doc/deliverables/data/mobileObjectHighWorkloadMeans.csv: -------------------------------------------------------------------------------- 1 | hwts,returnTicks,replyTicks,migrationProbability 2 | 1,1.2047e+06,1.205e+06,0 3 | 2,1.256e+06,1.8992e+06,0.001 4 | 4,1.2813e+06,4.1893e+06,0.0005 5 | 8,1.296e+06,9.2533e+06,0.00025 6 | 16,1.3015e+06,1.9605e+07,0.00012501 7 | 32,1.3053e+06,4.0424e+07,6.2502e-05 8 | 64,1.3084e+06,8.2113e+07,1.5625e-05 9 | 128,1.3091e+06,1.6555e+08,1.5625e-05 10 | 240,1.3094e+06,3.1155e+08,8.3333e-06 11 | -------------------------------------------------------------------------------- /doc/deliverables/data/mobileObjectLowWorkloadMeans.csv: -------------------------------------------------------------------------------- 1 | hwts,returnTicks,replyTicks,migrationProbability 2 | 1,4662.7,4911.5,0 3 | 2,6791.9,7298,0.888 4 | 4,8100.6,8474.5,0.99925 5 | 8,7419.7,7749,0.99962 6 | 16,7233.9,7548.8,0.99981 7 | 32,6812.2,7086.7,0.99991 8 | 64,7707.1,7975,0.99995 9 | 128,10558,10826,0.99998 10 | 240,13885,14154,0.99997 11 | -------------------------------------------------------------------------------- /doc/deliverables/fig/DerivedReferenceBits.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManyThreads/mythos/723a4b11e454a0c28e096755140c5e0eecf6a211/doc/deliverables/fig/DerivedReferenceBits.pdf -------------------------------------------------------------------------------- /doc/deliverables/fig/Makefile: -------------------------------------------------------------------------------- 1 | # files 2 | 3 | VECTOR_FILES := \ 4 | $(patsubst %.svg,%.pdf,$(shell find . -type f -name '*.svg')) \ 5 | $(patsubst %.dia,%.pdf,$(shell find . -type f -name '*.dia')) 6 | 7 | # patterns 8 | 9 | %.pdf : %.svg 10 | inkscape --without-gui "$<" --export-pdf="$@" 11 | 12 | %.svg : %.dia 13 | dia --filter=svg --export="$@" "$<" 14 | 15 | # targets 16 | 17 | vectors: $(VECTOR_FILES) 18 | echo $(sort $(VECTOR_FILES)) > vectors 19 | 20 | clean: vectors 21 | rm `cat vectors` 22 | rm vectors 23 | -------------------------------------------------------------------------------- /doc/deliverables/fig/cap-tree.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManyThreads/mythos/723a4b11e454a0c28e096755140c5e0eecf6a211/doc/deliverables/fig/cap-tree.pdf -------------------------------------------------------------------------------- /doc/deliverables/fig/capability-model.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManyThreads/mythos/723a4b11e454a0c28e096755140c5e0eecf6a211/doc/deliverables/fig/capability-model.pdf -------------------------------------------------------------------------------- /doc/deliverables/fig/capability-states.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManyThreads/mythos/723a4b11e454a0c28e096755140c5e0eecf6a211/doc/deliverables/fig/capability-states.pdf -------------------------------------------------------------------------------- /doc/deliverables/fig/kernel-object-cap.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManyThreads/mythos/723a4b11e454a0c28e096755140c5e0eecf6a211/doc/deliverables/fig/kernel-object-cap.pdf -------------------------------------------------------------------------------- /doc/deliverables/fig/kernel-objects-logical.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManyThreads/mythos/723a4b11e454a0c28e096755140c5e0eecf6a211/doc/deliverables/fig/kernel-objects-logical.pdf -------------------------------------------------------------------------------- /doc/deliverables/fig/layers.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManyThreads/mythos/723a4b11e454a0c28e096755140c5e0eecf6a211/doc/deliverables/fig/layers.pdf -------------------------------------------------------------------------------- /doc/deliverables/fig/portal.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManyThreads/mythos/723a4b11e454a0c28e096755140c5e0eecf6a211/doc/deliverables/fig/portal.pdf -------------------------------------------------------------------------------- /doc/deliverables/fig/tasklet-class.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManyThreads/mythos/723a4b11e454a0c28e096755140c5e0eecf6a211/doc/deliverables/fig/tasklet-class.pdf -------------------------------------------------------------------------------- /doc/ihk_integration.txt: -------------------------------------------------------------------------------- 1 | IHK integration 2 | =============== 3 | 4 | IHK offers 5 | ---------- 6 | 7 | ihkconfig: 8 | - configures the IHK device 9 | 10 | ihkmond: 11 | - Sequence hungup detector and kmsg taker with the coordination with creation/destruction events of McKernel 12 | 13 | ihkosctl: 14 | - configures the OSs on coprocessors 15 | 16 | IHK/McKernel boot sequence 17 | ---------------------------------- 18 | 19 | $sudo ./sbin/mcreboot.sh -c 1 -m 512m 20 | 1. (Start) ihkmond: 21 | - kill ihkmond if running 22 | - maybe start ihkmond 23 | 2. Figure out number of cores 24 | 3. Stop irqbalance and save irq affinities (only first mcreboot) 25 | 4. Prevent /proc/irq/*/smp_affinity from getting zero after offlining McKernel CPUs by using the following algorithm. 26 | 5. Set umask so that proc/sys files/directories created by mcctrl.ko and mcreboot.sh have appropriate permission bits 27 | 6. Load IHK kernel module if not loaded 28 | 7. Increase swappiness so that we have better chance to allocate memory for IHK 29 | 8. Drop Linux caches to free memory 30 | 9. Merge free memory areas into large, physically contigous ones 31 | 10. Load IHK-SMP kernel module if not loaded 32 | 11. Offline-reonline RAM (special cases) 33 | 12. Reserve CPUs and memory 34 | 13. Load mcctrl kernel module if not loaded 35 | 14. Check that different versions of binaries/scripts are not mixed 36 | 15. Destroy all LWK (Light-weight kernel, mcos) instances 37 | 16. Create OS instance (ihkconfig create) 38 | 17. Assign CPUs 39 | 18. Assign memory 40 | 19. Load kernel image 41 | 20. Set kernel arguments 42 | 21. Boot OS instance 43 | 22. Set device file ownership 44 | 23. Start irqbalance with CPUs and IRQ for McKernel banned 45 | 46 | $./sbin/ihkosctl 0 kmsg 47 | 1. 48 | -------------------------------------------------------------------------------- /host-knc.config: -------------------------------------------------------------------------------- 1 | # -*- mode:toml; -*- 2 | [config] 3 | # search paths relative to position of the config file 4 | moduledirs = ["kernel"] 5 | destdir = "host-knc" 6 | 7 | # pseudo modules and so on that are assumed as available 8 | provides = [ 9 | "tag/cpu/amd64", 10 | "tag/cpu/pause", 11 | "tag/cpu/clflush", 12 | "tag/mode/host", 13 | "tag/platform/pc", 14 | "tag/compiler/gcc", 15 | ] 16 | 17 | requires = [ 18 | "xmicterm", 19 | "Makefile", 20 | ] 21 | 22 | modules = [ "gitignore" ] 23 | 24 | [config.vars] 25 | mythos_root = ".." 26 | -------------------------------------------------------------------------------- /kernel-amd64.config: -------------------------------------------------------------------------------- 1 | # -*- mode:toml; -*- 2 | [config] 3 | # search paths relative to position of the config file 4 | moduledirs = ["kernel", "arch-config"] 5 | destdir = "kernel-amd64" 6 | 7 | provides = [ 8 | ] 9 | 10 | modules = [ 11 | "arch-amd64", 12 | "doxygen", 13 | "gitignore", 14 | "thread-mutex-delegating", 15 | # "thread-mutex-tidex", 16 | # "plugin-test-places", 17 | # "plugin-test-caps", 18 | "plugin-dump-multiboot", 19 | "plugin-rapl-driver-intel", 20 | "app-init-example", 21 | "test-synchronous-task", 22 | "plugin-test-perfmon", 23 | "plugin-processor-allocator" 24 | ] 25 | 26 | [config.vars] 27 | mythos_root = ".." 28 | cxx_path = "../3rdparty/cxx-amd64/usr" 29 | -------------------------------------------------------------------------------- /kernel-ihk.config: -------------------------------------------------------------------------------- 1 | # -*- mode:toml; -*- 2 | [config] 3 | # search paths relative to position of the config file 4 | moduledirs = ["kernel", "arch-config"] 5 | destdir = "kernel-ihk" 6 | 7 | provides = [ 8 | ] 9 | 10 | modules = [ 11 | "arch-ihk", 12 | "doxygen", 13 | "kernel-amd64-ihk", 14 | "gitignore", 15 | "thread-mutex-delegating", 16 | # "thread-mutex-tidex", 17 | # "plugin-test-places", 18 | # "plugin-test-caps", 19 | "plugin-rapl-driver-intel", 20 | "app-init-example", 21 | "plugin-test-perfmon", 22 | "plugin-processor-allocator" 23 | ] 24 | 25 | [config.vars] 26 | mythos_root = ".." 27 | cxx_path = "../3rdparty/cxx-amd64/usr" 28 | -------------------------------------------------------------------------------- /kernel-knc.config: -------------------------------------------------------------------------------- 1 | # -*- mode:toml; -*- 2 | [config] 3 | # search paths relative to position of the config file 4 | moduledirs = ["kernel", "arch-config"] 5 | destdir = "kernel-knc" 6 | 7 | # pseudo modules and so on that are assumed as available 8 | provides = [ 9 | ] 10 | 11 | requires = [ 12 | "boot64.elf", 13 | "Makefile", 14 | ] 15 | 16 | modules = [ 17 | "arch-knc", 18 | "gitignore", 19 | "thread-mutex-delegating", 20 | "plugin-dump-multiboot", 21 | "plugin-cpudriver-knc", 22 | "app-init-example", 23 | "kernel-idle-knc", 24 | ] 25 | 26 | [config.vars] 27 | mythos_root = ".." 28 | cxx_path = "../3rdparty/cxx-knc/usr" 29 | -------------------------------------------------------------------------------- /kernel/app/init-example/mcconf.module: -------------------------------------------------------------------------------- 1 | # -*- mode:toml; -*- 2 | [module.app-init-example] 3 | initappfiles = [ "app/init.cc" ] 4 | provides = [ "app/init.elf" ] 5 | requires = [ "crtbegin", "app-process-test"] 6 | 7 | makefile_head = ''' 8 | MY_MEMSIZE = 2G 9 | IHK_MEMSIZE = $(MY_MEMSIZE) 10 | QEMU_MEMSIZE = $(MY_MEMSIZE) 11 | 12 | TARGETS += app/init.elf 13 | APP_CXXFLAGS += -fopenmp 14 | ''' 15 | 16 | makefile_body = ''' 17 | app/init.elf: $(INITAPPFILES_OBJ) $(APPFILES_OBJ) $(CRTFILES_OBJ) 18 | $(APP_CXX) $(APP_LDFLAGS) $(APP_CXXFLAGS) -nostdlib -o $@ runtime/start.o runtime/crtbegin.o $(INITAPPFILES_OBJ) $(APPFILES_OBJ) $(APP_LIBS) runtime/crtend.o 19 | $(NM) $@ | cut -d " " -f 1,3 | c++filt -t > init.sym 20 | $(OBJDUMP) -dS $@ | c++filt > init.disasm 21 | $(STRIP) $@ 22 | ''' 23 | 24 | -------------------------------------------------------------------------------- /kernel/app/process_test/app/images.S: -------------------------------------------------------------------------------- 1 | /* -*- mode:asm; indent-tabs-mode:nil -*- */ 2 | /* MIT License -- MyThOS: The Many-Threads Operating System 3 | * 4 | * Permission is hereby granted, free of charge, to any person 5 | * obtaining a copy of this software and associated documentation 6 | * files (the "Software"), to deal in the Software without 7 | * restriction, including without limitation the rights to use, copy, 8 | * modify, merge, publish, distribute, sublicense, and/or sell copies 9 | * of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be 13 | * included in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 19 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 20 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | * Copyright 2020 Philipp Gypser and contributors, BTU Cottbus-Senftenberg 25 | */ 26 | 27 | // copy this section for each elf image 28 | .global process_test_image_start 29 | process_test_image_start: 30 | .incbin "process_test/process_test.elf" 31 | 32 | .global process_test_image_end 33 | process_test_image_end: 34 | -------------------------------------------------------------------------------- /kernel/app/process_test/mcconf.module: -------------------------------------------------------------------------------- 1 | # -*- mode:toml; -*- 2 | [module.app-process-test] 3 | initappfiles = [ "app/images.S" ] 4 | processtestappfiles = [ "process_test/process_test.cc", "process_test/mlog.cc" ] 5 | requires = [ "crtbegin"] 6 | provides = [ "app-process-test" ] 7 | 8 | makefile_head = ''' 9 | TARGETS += process_test/process_test.elf 10 | PROCESSTESTAPP_CXX ?= $(APP_CXX) 11 | PROCESSTESTAPP_AS ?= $(APP_AS) 12 | PROCESSTESTAPP_CXXFLAGS += $(APP_CXXFLAGS) 13 | PROCESSTESTAPP_CPPFLAGS += $(APP_CPPFLAGS) 14 | PROCESSTESTAPP_CXXFLAGS += -fno-stack-protector 15 | PROCESSTESTAPP_ASFLAGS += $(APP_ASFLAGS) 16 | APP_IMAGES = process_test/process_test.elf 17 | ''' 18 | 19 | makefile_body = ''' 20 | app/images.o: $(APP_IMAGES) 21 | 22 | process_test/process_test.elf: $(PROCESSTESTAPPFILES_OBJ) $(APPFILES_OBJ) $(CRTFILES_OBJ) 23 | $(APP_CXX) $(APP_LDFLAGS) $(APP_CXXFLAGS) -nostdlib -o $@ runtime/start.o runtime/crtbegin.o $(PROCESSTESTAPPFILES_OBJ) $(APPFILES_OBJ) $(APP_LIBS) runtime/crtend.o 24 | $(NM) $@ | cut -d " " -f 1,3 | c++filt -t > process_test.sym 25 | $(OBJDUMP) -dS $@ | c++filt > process_test.disasm 26 | $(STRIP) $@ 27 | ''' 28 | 29 | -------------------------------------------------------------------------------- /kernel/app/process_test/process_test/mlog.cc: -------------------------------------------------------------------------------- 1 | /* -*- mode:C++; -*- */ 2 | /* MIT License -- MyThOS: The Many-Threads Operating System 3 | * 4 | * Permission is hereby granted, free of charge, to any person 5 | * obtaining a copy of this software and associated documentation 6 | * files (the "Software"), to deal in the Software without 7 | * restriction, including without limitation the rights to use, copy, 8 | * modify, merge, publish, distribute, sublicense, and/or sell copies 9 | * of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be 13 | * included in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 19 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 20 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | * Copyright 2020 Philipp Gypser, Randolf Rotta, Maik Krüger, and contributors, BTU Cottbus-Senftenberg 25 | */ 26 | 27 | #include "runtime/mlog.hh" 28 | #include "util/error-trace.hh" 29 | 30 | namespace mlog { 31 | Logger app("process-test"); 32 | Logger throw_error("throw"); 33 | Logger testLog("Test"); 34 | } // namespace mlog 35 | -------------------------------------------------------------------------------- /kernel/async/mlog/async/mlog.cc: -------------------------------------------------------------------------------- 1 | /* -*- mode:C++; -*- */ 2 | /* MIT License -- MyThOS: The Many-Threads Operating System 3 | * 4 | * Permission is hereby granted, free of charge, to any person 5 | * obtaining a copy of this software and associated documentation 6 | * files (the "Software"), to deal in the Software without 7 | * restriction, including without limitation the rights to use, copy, 8 | * modify, merge, publish, distribute, sublicense, and/or sell copies 9 | * of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be 13 | * included in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 19 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 20 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | * Copyright 2014 Randolf Rotta, Maik Krüger, and contributors, BTU Cottbus-Senftenberg 25 | */ 26 | 27 | #include "async/mlog.hh" 28 | 29 | namespace mlog { 30 | Logger async("async"); 31 | } // namespace mlog 32 | -------------------------------------------------------------------------------- /kernel/async/mlog/async/mlog.hh: -------------------------------------------------------------------------------- 1 | /* -*- mode:C++; -*- */ 2 | /* MIT License -- MyThOS: The Many-Threads Operating System 3 | * 4 | * Permission is hereby granted, free of charge, to any person 5 | * obtaining a copy of this software and associated documentation 6 | * files (the "Software"), to deal in the Software without 7 | * restriction, including without limitation the rights to use, copy, 8 | * modify, merge, publish, distribute, sublicense, and/or sell copies 9 | * of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be 13 | * included in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 19 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 20 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | * Copyright 2014 Randolf Rotta, Maik Krüger, and contributors, BTU Cottbus-Senftenberg 25 | */ 26 | #pragma once 27 | 28 | #include "util/Logger.hh" 29 | 30 | namespace mlog { 31 | 32 | #ifndef MLOG_ASYNC 33 | #define MLOG_ASYNC FilterWarning 34 | #endif 35 | 36 | extern mlog::Logger async; 37 | 38 | } // namespace mlog 39 | -------------------------------------------------------------------------------- /kernel/async/mlog/mcconf.module: -------------------------------------------------------------------------------- 1 | # -*- mode:toml; -*- 2 | [module.mlog-async] 3 | incfiles = [ "async/mlog.hh" ] 4 | kernelfiles = ["async/mlog.cc" ] 5 | -------------------------------------------------------------------------------- /kernel/async/monitor-common/async/notes.md: -------------------------------------------------------------------------------- 1 | template 2 | class IResult 3 | { 4 | public: 5 | virtual ~IResult() {} 6 | virtual void response(Tasklet*, T const&... v) = 0; 7 | virtual void error(Tasklet*, Error e) = 0; 8 | }; 9 | 10 | template 11 | class FuncSink 12 | : public IResult 13 | { 14 | public: 15 | typedef void (*SuccessFun)(H, Tasklet*, T const&...); 16 | typedef void (*ErrorFun)(H, Tasklet*, Error); 17 | FuncSink(H handle, SuccessFun sfun, ErrorFun efun) 18 | : handle(handle), sfun(sfun), efun(efun) {} 19 | virtual ~FuncSink() {} 20 | virtual void response(Tasklet* t, T const&... v) { sfun(handle, t, v...); } 21 | virtual void error(Tasklet* t, Error e) { efun(handle, t, e); } 22 | protected: 23 | H handle; 24 | SuccessFun sfun; 25 | ErrorFun efun; 26 | }; 27 | 28 | template 29 | class MSink 30 | : public IResult 31 | { 32 | public: 33 | MSink(O* obj) : obj(obj) {} 34 | virtual ~MSink() {} 35 | virtual void response(Tasklet* t, T const& v) { (obj->*SM)(t, v); } 36 | virtual void error(Tasklet* t, Error e) { (obj->*EM)(t, e); } 37 | protected: 38 | T* obj; 39 | }; 40 | 41 | template 42 | class MHSink 43 | : public IResult 44 | { 45 | public: 46 | MHSink(O* obj, H handle) : obj(obj), handle(handle) {} 47 | virtual ~MHSink() {} 48 | virtual void response(Tasklet* t, T const& v) { (obj->*SM)(handle, t, v); } 49 | virtual void error(Tasklet* t, Error e) { (obj->*EM)(handle, t, e); } 50 | protected: 51 | T* obj; 52 | H handle; 53 | }; 54 | -------------------------------------------------------------------------------- /kernel/async/monitor-common/mcconf.module: -------------------------------------------------------------------------------- 1 | # -*- mode:toml; -*- 2 | [module.monitor-common] 3 | incfiles = [ "async/Place.hh", "async/Tasklet.hh", "async/TaskletQueue.hh", 4 | "async/DeletionMonitor.hh", "async/IResult.hh", "async/KFuture.hh" ] 5 | kernelfiles = [ "async/Place.cc" ] 6 | -------------------------------------------------------------------------------- /kernel/async/monitor-delegating/mcconf.module: -------------------------------------------------------------------------------- 1 | # -*- mode:toml; -*- 2 | 3 | [module.monitor-delegating] 4 | incfiles = [ "async/MonitorDelegating.hh", "async/DelegationQueue.hh" ] -------------------------------------------------------------------------------- /kernel/async/monitor-homed/mcconf.module: -------------------------------------------------------------------------------- 1 | # -*- mode:toml; -*- 2 | 3 | [module.monitor-homed] 4 | incfiles = [ "async/MonitorHomed.hh", "async/Queues.hh" ] 5 | -------------------------------------------------------------------------------- /kernel/async/monitor-stateless/async/MonitorStateless.hh: -------------------------------------------------------------------------------- 1 | /* -*- mode:C++; indent-tabs-mode:nil; -*- */ 2 | /* MIT License -- MyThOS: The Many-Threads Operating System 3 | * 4 | * Permission is hereby granted, free of charge, to any person 5 | * obtaining a copy of this software and associated documentation 6 | * files (the "Software"), to deal in the Software without 7 | * restriction, including without limitation the rights to use, copy, 8 | * modify, merge, publish, distribute, sublicense, and/or sell copies 9 | * of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be 13 | * included in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 19 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 20 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | * Copyright 2016 Randolf Rotta, Robert Kuban, and contributors, BTU Cottbus-Senftenberg 25 | */ 26 | #pragma once 27 | 28 | #include "util/assert.hh" 29 | #include "async/Place.hh" 30 | 31 | namespace mythos { 32 | namespace async { 33 | 34 | /** 35 | * Simple monitor for stateless asyncronous objects. 36 | */ 37 | 38 | class MonitorStateless 39 | { 40 | public: 41 | 42 | template 43 | void async(Tasklet* msg, FUNCTOR fun) { 44 | getLocalPlace().pushShared(msg->set(fun)); 45 | } 46 | 47 | }; 48 | 49 | } // async 50 | } //mythos 51 | -------------------------------------------------------------------------------- /kernel/async/monitor-stateless/mcconf.module: -------------------------------------------------------------------------------- 1 | # -*- mode:toml; -*- 2 | 3 | [module.monitor-stateless] 4 | incfiles = [ "async/MonitorStateless.hh" ] 5 | -------------------------------------------------------------------------------- /kernel/async/mutex-delegating/mcconf.module: -------------------------------------------------------------------------------- 1 | # -*- mode:toml; -*- 2 | [module.async-mutex-delegating] 3 | incfiles = [ "async/MutexDelegating.hh" ] 4 | kernelfiles = [ "async/MutexDelegating.cc" ] 5 | 6 | [module.thread-mutex-delegating] 7 | incfiles = [ "util/ThreadMutex.hh" ] 8 | -------------------------------------------------------------------------------- /kernel/async/mutex-delegating/util/ThreadMutex.hh: -------------------------------------------------------------------------------- 1 | /* -*- mode:C++; -*- */ 2 | /* MIT License -- MyThOS: The Many-Threads Operating System 3 | * 4 | * Permission is hereby granted, free of charge, to any person 5 | * obtaining a copy of this software and associated documentation 6 | * files (the "Software"), to deal in the Software without 7 | * restriction, including without limitation the rights to use, copy, 8 | * modify, merge, publish, distribute, sublicense, and/or sell copies 9 | * of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be 13 | * included in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 19 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 20 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | * Copyright 2016 Martin Messer, BTU Cottbus-Senftenberg 25 | */ 26 | 27 | #pragma once 28 | 29 | #include "async/MutexDelegating.hh" 30 | 31 | namespace mythos{ 32 | 33 | typedef async::MutexDelegating ThreadMutex; 34 | 35 | } // namespace mythos 36 | -------------------------------------------------------------------------------- /kernel/async/nested-monitor-delegating/mcconf.module: -------------------------------------------------------------------------------- 1 | # -*- mode:toml; -*- 2 | [module.nested-monitor-delegating] 3 | incfiles = [ "async/NestedMonitorDelegating.hh" ] 4 | kernelfiles = [ "async/NestedMonitorDelegating.cc" ] 5 | -------------------------------------------------------------------------------- /kernel/async/nested-monitor-dummy/mcconf.module: -------------------------------------------------------------------------------- 1 | # -*- mode:toml; -*- 2 | [module.nested-monitor-dummy] 3 | incfiles = [ "async/NestedMonitorDummy.hh" ] 4 | -------------------------------------------------------------------------------- /kernel/async/nested-monitor-home/mcconf.module: -------------------------------------------------------------------------------- 1 | # -*- mode:toml; -*- 2 | [module.nested-monitor-home] 3 | incfiles = [ "async/NestedMonitorHome.hh" ] 4 | kernelfiles = [ "async/NestedMonitorHome.cc" ] 5 | 6 | 7 | -------------------------------------------------------------------------------- /kernel/async/simple-monitor-home/mcconf.module: -------------------------------------------------------------------------------- 1 | # -*- mode:toml; -*- 2 | [module.simple-monitor-home] 3 | incfiles = [ "async/SimpleMonitorHome.hh" ] 4 | -------------------------------------------------------------------------------- /kernel/async/synchronous-task/mcconf.module: -------------------------------------------------------------------------------- 1 | # -*- mode:toml; -*- 2 | [module.synchronous-task] 3 | incfiles = [ "async/SynchronousTask.hh" ] 4 | 5 | [module.test-synchronous-task] 6 | kernelfiles = [ "async/test-SynchronousTask.cc" ] 7 | -------------------------------------------------------------------------------- /kernel/boot/apboot-acpi/boot/apboot.hh: -------------------------------------------------------------------------------- 1 | /* -*- mode:C++; -*- */ 2 | /* MIT License -- MyThOS: The Many-Threads Operating System 3 | * 4 | * Permission is hereby granted, free of charge, to any person 5 | * obtaining a copy of this software and associated documentation 6 | * files (the "Software"), to deal in the Software without 7 | * restriction, including without limitation the rights to use, copy, 8 | * modify, merge, publish, distribute, sublicense, and/or sell copies 9 | * of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be 13 | * included in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 19 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 20 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | * Copyright 2014 Randolf Rotta, Maik Krüger, and contributors, BTU Cottbus-Senftenberg 25 | */ 26 | #pragma once 27 | 28 | #include "util/compiler.hh" 29 | #include 30 | 31 | namespace mythos { 32 | namespace boot { 33 | 34 | NORETURN void apboot(); 35 | bool apboot_thread(size_t apicID, size_t reason); 36 | 37 | } // namespace boot 38 | } // namespace mythos 39 | -------------------------------------------------------------------------------- /kernel/boot/apboot-acpi/mcconf.module: -------------------------------------------------------------------------------- 1 | # -*- mode:toml; -*- 2 | [module.apboot-acpi] 3 | incfiles = [ "boot/apboot.hh" ] 4 | kernelfiles = [ "boot/apboot.cc" ] 5 | requires = [ "tag/boot/acpi" ] 6 | -------------------------------------------------------------------------------- /kernel/boot/apboot-common/mcconf.module: -------------------------------------------------------------------------------- 1 | # -*- mode:toml; -*- 2 | [module.apboot-common] 3 | incfiles = [ "boot/DeployHWThread.hh" ] 4 | kernelfiles = [ "boot/DeployHWThread.cc" ] -------------------------------------------------------------------------------- /kernel/boot/apboot-ihk/boot/apboot.hh: -------------------------------------------------------------------------------- 1 | /* -*- mode:C++; -*- */ 2 | /* MIT License -- MyThOS: The Many-Threads Operating System 3 | * 4 | * Permission is hereby granted, free of charge, to any person 5 | * obtaining a copy of this software and associated documentation 6 | * files (the "Software"), to deal in the Software without 7 | * restriction, including without limitation the rights to use, copy, 8 | * modify, merge, publish, distribute, sublicense, and/or sell copies 9 | * of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be 13 | * included in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 19 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 20 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | * Copyright 2014 Randolf Rotta, Maik Krüger, and contributors, BTU Cottbus-Senftenberg 25 | */ 26 | #pragma once 27 | 28 | #include "util/compiler.hh" 29 | #include 30 | 31 | namespace mythos { 32 | namespace boot { 33 | 34 | /** boot the BSP and all AP hardware threads such that they arrive in entry_ap(). */ 35 | NORETURN void apboot(); 36 | 37 | /** perform thread-local initialisation after booting the hardware thread. */ 38 | bool apboot_thread(size_t apicID, size_t reason); 39 | 40 | } // namespace boot 41 | } // namespace mythos 42 | -------------------------------------------------------------------------------- /kernel/boot/apboot-ihk/mcconf.module: -------------------------------------------------------------------------------- 1 | # -*- mode:toml; -*- 2 | [module.apboot-ihk] 3 | incfiles = [ "boot/apboot.hh" ] 4 | kernelfiles = [ "boot/apboot.cc" ] 5 | requires = [ "tag/boot/ihk" ] 6 | -------------------------------------------------------------------------------- /kernel/boot/apboot-mp/boot/apboot.hh: -------------------------------------------------------------------------------- 1 | /* -*- mode:C++; -*- */ 2 | /* MIT License -- MyThOS: The Many-Threads Operating System 3 | * 4 | * Permission is hereby granted, free of charge, to any person 5 | * obtaining a copy of this software and associated documentation 6 | * files (the "Software"), to deal in the Software without 7 | * restriction, including without limitation the rights to use, copy, 8 | * modify, merge, publish, distribute, sublicense, and/or sell copies 9 | * of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be 13 | * included in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 19 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 20 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | * Copyright 2014 Randolf Rotta, Maik Krüger, and contributors, BTU Cottbus-Senftenberg 25 | */ 26 | #pragma once 27 | 28 | #include "util/compiler.hh" 29 | #include 30 | 31 | namespace mythos { 32 | namespace boot { 33 | 34 | NORETURN void apboot(); 35 | bool apboot_thread(size_t apicID, size_t reason); 36 | 37 | } // namespace boot 38 | } // namespace mythos 39 | -------------------------------------------------------------------------------- /kernel/boot/apboot-mp/mcconf.module: -------------------------------------------------------------------------------- 1 | # -*- mode:toml; -*- 2 | [module.apboot-intelmp] 3 | incfiles = [ "boot/apboot.hh" ] 4 | kernelfiles = [ "boot/apboot.cc" ] 5 | requires = [ "tag/boot/intelmp" ] 6 | -------------------------------------------------------------------------------- /kernel/boot/apboot-sfi/boot/apboot.hh: -------------------------------------------------------------------------------- 1 | /* -*- mode:C++; -*- */ 2 | /* MIT License -- MyThOS: The Many-Threads Operating System 3 | * 4 | * Permission is hereby granted, free of charge, to any person 5 | * obtaining a copy of this software and associated documentation 6 | * files (the "Software"), to deal in the Software without 7 | * restriction, including without limitation the rights to use, copy, 8 | * modify, merge, publish, distribute, sublicense, and/or sell copies 9 | * of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be 13 | * included in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 19 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 20 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | * Copyright 2014 Randolf Rotta, Maik Krüger, and contributors, BTU Cottbus-Senftenberg 25 | */ 26 | #pragma once 27 | 28 | #include "util/compiler.hh" 29 | #include 30 | 31 | namespace mythos { 32 | namespace boot { 33 | 34 | NORETURN void apboot(); 35 | boot apboot_thread(size_t apicID, size_t reason); 36 | 37 | } // namespace boot 38 | } // namespace mythos 39 | -------------------------------------------------------------------------------- /kernel/boot/apboot-sfi/mcconf.module: -------------------------------------------------------------------------------- 1 | # -*- mode:toml; -*- 2 | [module.apboot-sfi] 3 | incfiles = [ "boot/apboot.hh" ] 4 | kernelfiles = [ "boot/apboot.cc" ] 5 | requires = [ "tag/boot/sfi" ] 6 | -------------------------------------------------------------------------------- /kernel/boot/cxx-globals/mcconf.module: -------------------------------------------------------------------------------- 1 | # -*- mode:toml; -*- 2 | [module.cxx-globals] 3 | incfiles = [ "boot/cxx-globals.hh" ] 4 | -------------------------------------------------------------------------------- /kernel/boot/init-loader-amd64/boot/init_image.S: -------------------------------------------------------------------------------- 1 | /* -*- mode:asm; indent-tabs-mode:nil -*- */ 2 | /* MIT License -- MyThOS: The Many-Threads Operating System 3 | * 4 | * Permission is hereby granted, free of charge, to any person 5 | * obtaining a copy of this software and associated documentation 6 | * files (the "Software"), to deal in the Software without 7 | * restriction, including without limitation the rights to use, copy, 8 | * modify, merge, publish, distribute, sublicense, and/or sell copies 9 | * of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be 13 | * included in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 19 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 20 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | * Copyright 2016 Randolf Rotta, Robert Kuban, Maik Krüger, and contributors, BTU Cottbus-Senftenberg 25 | */ 26 | 27 | .global app_image_start 28 | app_image_start: 29 | .incbin "app/init.elf" 30 | 31 | .global app_image_end 32 | app_image_end: 33 | -------------------------------------------------------------------------------- /kernel/boot/init-loader-amd64/mcconf.module: -------------------------------------------------------------------------------- 1 | # -*- mode:toml; -*- 2 | [module.boot-init-loader-amd64] 3 | incfiles = [ "boot/load_init.hh", "boot/MemMapper.hh", 4 | "boot/CapAlloc.hh" ] 5 | kernelfiles = [ "boot/init_image.S", "boot/load_init.cc", 6 | "boot/MemMapper.cc", "boot/load_init_plugin.cc" ] 7 | requires = [ "app/init.elf" ] 8 | makefile_body = ''' 9 | boot/init_image.o: app/init.elf 10 | ''' 11 | -------------------------------------------------------------------------------- /kernel/boot/kernel-amd64-ihk/boot/DeployKernelSpace.hh: -------------------------------------------------------------------------------- 1 | /* -*- mode:C++; -*- */ 2 | /* MIT License -- MyThOS: The Many-Threads Operating System 3 | * 4 | * Permission is hereby granted, free of charge, to any person 5 | * obtaining a copy of this software and associated documentation 6 | * files (the "Software"), to deal in the Software without 7 | * restriction, including without limitation the rights to use, copy, 8 | * modify, merge, publish, distribute, sublicense, and/or sell copies 9 | * of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be 13 | * included in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 19 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 20 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | * Copyright 2014 Randolf Rotta, Maik Krüger, and contributors, BTU Cottbus-Senftenberg 25 | */ 26 | #pragma once 27 | 28 | #include "boot/init-kernelspace-common.hh" 29 | 30 | namespace mythos { 31 | namespace boot { 32 | 33 | inline void initKernelSpace() { initKernelSpaceCommon(); } 34 | 35 | } // boot 36 | } // namespace mythos 37 | -------------------------------------------------------------------------------- /kernel/boot/kernel-amd64-ihk/boot/kmem.hh: -------------------------------------------------------------------------------- 1 | /* -*- mode:C++; -*- */ 2 | /* MIT License -- MyThOS: The Many-Threads Operating System 3 | * 4 | * Permission is hereby granted, free of charge, to any person 5 | * obtaining a copy of this software and associated documentation 6 | * files (the "Software"), to deal in the Software without 7 | * restriction, including without limitation the rights to use, copy, 8 | * modify, merge, publish, distribute, sublicense, and/or sell copies 9 | * of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be 13 | * included in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 19 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 20 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | * Copyright 2014 Randolf Rotta, Maik Krüger, and contributors, BTU Cottbus-Senftenberg 25 | */ 26 | #pragma once 27 | 28 | 29 | namespace mythos { 30 | class KernelMemory; 31 | 32 | namespace boot { 33 | 34 | void initKernelMemory(KernelMemory& km); 35 | 36 | } // namespace boot 37 | } // namespace mythos 38 | -------------------------------------------------------------------------------- /kernel/boot/kernel-amd64-ihk/boot/memory-layout.h: -------------------------------------------------------------------------------- 1 | /* -*- mode:C++; -*- */ 2 | /* MIT License -- MyThOS: The Many-Threads Operating System 3 | * 4 | * Permission is hereby granted, free of charge, to any person 5 | * obtaining a copy of this software and associated documentation 6 | * files (the "Software"), to deal in the Software without 7 | * restriction, including without limitation the rights to use, copy, 8 | * modify, merge, publish, distribute, sublicense, and/or sell copies 9 | * of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be 13 | * included in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 19 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 20 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | * Copyright 2014 Randolf Rotta, Maik Krüger, and contributors, BTU Cottbus-Senftenberg 25 | */ 26 | #pragma once 27 | 28 | #include "boot/memory-layout-common.h" 29 | -------------------------------------------------------------------------------- /kernel/boot/kernel-amd64-ihk/boot/mlog.hh: -------------------------------------------------------------------------------- 1 | /* -*- mode:C++; -*- */ 2 | /* MIT License -- MyThOS: The Many-Threads Operating System 3 | * 4 | * Permission is hereby granted, free of charge, to any person 5 | * obtaining a copy of this software and associated documentation 6 | * files (the "Software"), to deal in the Software without 7 | * restriction, including without limitation the rights to use, copy, 8 | * modify, merge, publish, distribute, sublicense, and/or sell copies 9 | * of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be 13 | * included in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 19 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 20 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | * Copyright 2014 Randolf Rotta, Maik Krüger, and contributors, BTU Cottbus-Senftenberg 25 | */ 26 | #pragma once 27 | 28 | #include "util/Logger.hh" 29 | 30 | namespace mythos { 31 | namespace boot { 32 | void initMLog(); 33 | } // namespace boot 34 | } // namespace mythos 35 | 36 | namespace mlog { 37 | 38 | #ifndef MLOG_BOOT 39 | #define MLOG_BOOT FilterInfo 40 | #endif 41 | 42 | extern mlog::Logger boot; 43 | 44 | } // namespace mlog 45 | -------------------------------------------------------------------------------- /kernel/boot/kernel-amd64-knc/boot/DeployKernelSpace.hh: -------------------------------------------------------------------------------- 1 | /* -*- mode:C++; -*- */ 2 | /* MIT License -- MyThOS: The Many-Threads Operating System 3 | * 4 | * Permission is hereby granted, free of charge, to any person 5 | * obtaining a copy of this software and associated documentation 6 | * files (the "Software"), to deal in the Software without 7 | * restriction, including without limitation the rights to use, copy, 8 | * modify, merge, publish, distribute, sublicense, and/or sell copies 9 | * of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be 13 | * included in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 19 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 20 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | * Copyright 2014 Randolf Rotta, Maik Krüger, and contributors, BTU Cottbus-Senftenberg 25 | */ 26 | #pragma once 27 | 28 | #include "boot/init-kernelspace-common.hh" 29 | 30 | namespace mythos { 31 | namespace boot { 32 | 33 | void initKernelSpace(); 34 | 35 | } // boot 36 | } // namespace mythos 37 | -------------------------------------------------------------------------------- /kernel/boot/kernel-amd64-knc/boot/memory-layout.h: -------------------------------------------------------------------------------- 1 | /* -*- mode:C++; -*- */ 2 | /* MIT License -- MyThOS: The Many-Threads Operating System 3 | * 4 | * Permission is hereby granted, free of charge, to any person 5 | * obtaining a copy of this software and associated documentation 6 | * files (the "Software"), to deal in the Software without 7 | * restriction, including without limitation the rights to use, copy, 8 | * modify, merge, publish, distribute, sublicense, and/or sell copies 9 | * of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be 13 | * included in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 19 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 20 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | * Copyright 2014 Randolf Rotta, Maik Krüger, and contributors, BTU Cottbus-Senftenberg 25 | */ 26 | #pragma once 27 | 28 | #include "boot/memory-layout-common.h" 29 | 30 | #define MMIO_ADDR 0xffff800100600000 31 | #define MMIO_PHYS 0x0000000800600000 32 | #define MMIO_SIZE 0x0000000000200000 /* 2MiB */ 33 | #define SBOX_BASE 0x00000000001D0000 34 | #define SBOX_SCRATCH2 0x000000000000AB28 35 | -------------------------------------------------------------------------------- /kernel/boot/kernel-amd64-knc/boot/mlog.hh: -------------------------------------------------------------------------------- 1 | /* -*- mode:C++; -*- */ 2 | /* MIT License -- MyThOS: The Many-Threads Operating System 3 | * 4 | * Permission is hereby granted, free of charge, to any person 5 | * obtaining a copy of this software and associated documentation 6 | * files (the "Software"), to deal in the Software without 7 | * restriction, including without limitation the rights to use, copy, 8 | * modify, merge, publish, distribute, sublicense, and/or sell copies 9 | * of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be 13 | * included in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 19 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 20 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | * Copyright 2014 Randolf Rotta, Maik Krüger, and contributors, BTU Cottbus-Senftenberg 25 | */ 26 | #pragma once 27 | 28 | #include "util/Logger.hh" 29 | 30 | namespace mythos { 31 | namespace boot { 32 | void initMLog(); 33 | } // namespace boot 34 | } // namespace mythos 35 | 36 | namespace mlog { 37 | 38 | #ifndef MLOG_BOOT 39 | #define MLOG_BOOT FilterAny 40 | #endif 41 | 42 | extern mlog::Logger boot; 43 | 44 | } // namespace mlog 45 | -------------------------------------------------------------------------------- /kernel/boot/kernel-amd64-knc/mcconf.module: -------------------------------------------------------------------------------- 1 | # -*- mode:toml; -*- 2 | [module.kernel-amd64-knc] 3 | incfiles = [ "boot/memory-layout.h", "boot/DeployKernelSpace.hh", "boot/mlog.hh", "boot/boot.ld" ] 4 | kernelfiles = [ "boot/start.S", "boot/DeployKernelSpace.cc", "boot/mlog.cc" ] 5 | requires = [ "tag/platform/knc", "symbol/entry_ap", "symbol/entry_bsp", ] # "symbol/host_info" 6 | provides = [ "boot64.elf", "symbol/host_info_ptr", "symbol/_mboot_table", "symbol/_mboot_magic" ] 7 | 8 | makefile_head = ''' 9 | # just for make clean 10 | EXTRATARGETS += boot/boot.o 11 | TARGETS += boot64.elf 12 | EXTRATARGETS += kernel2.cc kernel2.o 13 | DEP += kernel2.d 14 | ''' 15 | 16 | makefile_body = ''' 17 | kernel2_other = $(filter-out %.cc, $(KERNELFILES)) 18 | kernel2_obj = $(addsuffix .o, $(basename $(kernel2_other))) 19 | 20 | # apply preprocessor on linker script 21 | boot/boot.o: boot/boot.ld 22 | $(CPP) $(KERNEL_CPPFLAGS) $(DEPFLAGS) -E -P -xc boot/boot.ld -o boot/boot.o 23 | 24 | kernel2.cc: 25 | echo "" > kernel2.cc 26 | for F in $(filter %.cc, $(KERNELFILES)) ; do echo "#include \"$$F\"" >> kernel2.cc ; done 27 | 28 | kernel2.o: kernel2.cc 29 | $(KERNEL_CXX) $(KERNEL_CXXFLAGS) $(KERNEL_CPPFLAGS) $(DEPFLAGS) -c -o $@ $< 30 | 31 | boot64.elf: boot/boot.o $(kernel2_obj) kernel2.o 32 | $(KERNEL_LD) $(KERNEL_LFLAGS) -o boot64.elf -dT boot/boot.o kernel2.o $(kernel2_obj) 33 | #boot64.elf: boot/boot.o $(KERNELFILES_OBJ) 34 | # $(KERNEL_LD) $(KERNEL_LFLAGS) -o boot64.elf -dT boot/boot.o boot/start.o $(filter-out boot/start.o,$(KERNELFILES_OBJ)) 35 | $(NM) -n boot64.elf | cut -d " " -f 1,3 | c++filt -t > boot.sym 36 | $(NM) -S --size-sort -C boot64.elf > boot.size 37 | $(OBJDUMP) -dS boot64.elf | c++filt > boot.disasm 38 | $(STRIP) boot64.elf 39 | ''' 40 | -------------------------------------------------------------------------------- /kernel/boot/kernel-amd64-pc/boot/DeployKernelSpace.hh: -------------------------------------------------------------------------------- 1 | /* -*- mode:C++; -*- */ 2 | /* MIT License -- MyThOS: The Many-Threads Operating System 3 | * 4 | * Permission is hereby granted, free of charge, to any person 5 | * obtaining a copy of this software and associated documentation 6 | * files (the "Software"), to deal in the Software without 7 | * restriction, including without limitation the rights to use, copy, 8 | * modify, merge, publish, distribute, sublicense, and/or sell copies 9 | * of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be 13 | * included in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 19 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 20 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | * Copyright 2014 Randolf Rotta, Maik Krüger, and contributors, BTU Cottbus-Senftenberg 25 | */ 26 | #pragma once 27 | 28 | #include "boot/init-kernelspace-common.hh" 29 | 30 | namespace mythos { 31 | namespace boot { 32 | 33 | inline void initKernelSpace() { initKernelSpaceCommon(); } 34 | 35 | } // boot 36 | } // namespace mythos 37 | -------------------------------------------------------------------------------- /kernel/boot/kernel-amd64-pc/boot/memory-layout.h: -------------------------------------------------------------------------------- 1 | /* -*- mode:C++; -*- */ 2 | /* MIT License -- MyThOS: The Many-Threads Operating System 3 | * 4 | * Permission is hereby granted, free of charge, to any person 5 | * obtaining a copy of this software and associated documentation 6 | * files (the "Software"), to deal in the Software without 7 | * restriction, including without limitation the rights to use, copy, 8 | * modify, merge, publish, distribute, sublicense, and/or sell copies 9 | * of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be 13 | * included in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 19 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 20 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | * Copyright 2014 Randolf Rotta, Maik Krüger, and contributors, BTU Cottbus-Senftenberg 25 | */ 26 | #pragma once 27 | 28 | #include "boot/memory-layout-common.h" 29 | -------------------------------------------------------------------------------- /kernel/boot/kernel-amd64-pc/boot/mlog.hh: -------------------------------------------------------------------------------- 1 | /* -*- mode:C++; -*- */ 2 | /* MIT License -- MyThOS: The Many-Threads Operating System 3 | * 4 | * Permission is hereby granted, free of charge, to any person 5 | * obtaining a copy of this software and associated documentation 6 | * files (the "Software"), to deal in the Software without 7 | * restriction, including without limitation the rights to use, copy, 8 | * modify, merge, publish, distribute, sublicense, and/or sell copies 9 | * of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be 13 | * included in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 19 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 20 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | * Copyright 2014 Randolf Rotta, Maik Krüger, and contributors, BTU Cottbus-Senftenberg 25 | */ 26 | #pragma once 27 | 28 | #include "util/Logger.hh" 29 | 30 | namespace mythos { 31 | namespace boot { 32 | void initMLog(); 33 | } // namespace boot 34 | } // namespace mythos 35 | 36 | namespace mlog { 37 | 38 | #ifndef MLOG_BOOT 39 | #define MLOG_BOOT FilterInfo 40 | #endif 41 | 42 | extern mlog::Logger boot; 43 | 44 | } // namespace mlog 45 | -------------------------------------------------------------------------------- /kernel/boot/kernel-amd64-pc/mcconf.module: -------------------------------------------------------------------------------- 1 | # -*- mode:toml; -*- 2 | [module.kernel-amd64-pc] 3 | incfiles = [ "boot/mlog.hh", "boot/boot.ld", "boot/memory-layout.h" , "boot/DeployKernelSpace.hh"] 4 | kernelfiles = [ "boot/start.S", "boot/mlog.cc" ] 5 | requires = [ "tag/platform/pc", "symbol/entry_ap", "symbol/entry_bsp" ] 6 | provides = [ "boot32.elf", "boot64.elf", "symbol/_mboot_table", "symbol/_mboot_magic" ] 7 | 8 | makefile_head = ''' 9 | # just for make clean 10 | EXTRATARGETS += boot/boot.o 11 | TARGETS += boot32.elf boot64.elf 12 | EXTRATARGETS += kernel2.cc kernel2.o 13 | DEP += kernel2.d 14 | ''' 15 | 16 | makefile_body = ''' 17 | kernel2_other = $(filter-out %.cc, $(KERNELFILES)) 18 | kernel2_obj = $(addsuffix .o, $(basename $(kernel2_other))) 19 | 20 | # apply preprocessor on linker script 21 | boot/boot.o: boot/boot.ld 22 | $(CPP) $(KERNEL_CPPFLAGS) $(DEPFLAGS) -E -P -xc boot/boot.ld -o boot/boot.o 23 | 24 | kernel2.cc: 25 | echo "" > kernel2.cc 26 | for F in $(filter %.cc, $(KERNELFILES)) ; do echo "#include \"$$F\"" >> kernel2.cc ; done 27 | 28 | kernel2.o: kernel2.cc 29 | $(KERNEL_CXX) $(KERNEL_CXXFLAGS) $(KERNEL_CPPFLAGS) $(DEPFLAGS) -c -o $@ $< 30 | $(KERNEL_CXX) $(KERNEL_CXXFLAGS) $(KERNEL_CPPFLAGS) $(DEPFLAGS) -S -o $@.s $< 31 | 32 | boot64.elf: boot/boot.o $(kernel2_obj) kernel2.o 33 | $(KERNEL_LD) $(KERNEL_LFLAGS) -o boot64.elf -dT boot/boot.o kernel2.o $(kernel2_obj) 34 | $(NM) boot64.elf | cut -d " " -f 1,3 | c++filt -t > boot.sym 35 | $(NM) -S --size-sort -C boot64.elf > boot.size 36 | $(OBJDUMP) -dS boot64.elf | c++filt > boot.disasm 37 | 38 | boot32.elf: boot64.elf 39 | objcopy --strip-debug -I elf64-x86-64 -O elf32-i386 boot64.elf boot32.elf 40 | ''' 41 | 42 | [module.kernelspace-amd64-pc] 43 | incfiles = [ "boot/memory-layout.h", "boot/DeployKernelSpace.hh" ] 44 | -------------------------------------------------------------------------------- /kernel/boot/kernel-main/boot/kernel.hh: -------------------------------------------------------------------------------- 1 | /* -*- mode:C++; -*- */ 2 | /* MIT License -- MyThOS: The Many-Threads Operating System 3 | * 4 | * Permission is hereby granted, free of charge, to any person 5 | * obtaining a copy of this software and associated documentation 6 | * files (the "Software"), to deal in the Software without 7 | * restriction, including without limitation the rights to use, copy, 8 | * modify, merge, publish, distribute, sublicense, and/or sell copies 9 | * of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be 13 | * included in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 19 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 20 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | * Copyright 2019 Randolf Rotta and contributors, BTU Cottbus-Senftenberg 25 | */ 26 | #include "cpu/hwthreadid.hh" 27 | #include "util/events.hh" 28 | 29 | namespace mythos { 30 | namespace event { 31 | 32 | extern Event<> bootBSP; 33 | extern Event bootAP; 34 | 35 | /** event to initialize an ioApic. 36 | * Arguments are the number of the ioAPIC and its physical address. 37 | * The memory mapping is up to the plugins. 38 | */ 39 | extern Event initIOApic; 40 | 41 | } // namespace event 42 | } // namespace mythos 43 | -------------------------------------------------------------------------------- /kernel/boot/kernel-main/mcconf.module: -------------------------------------------------------------------------------- 1 | # -*- mode:toml; -*- 2 | [module.kernel-main] 3 | incfiles = [ "boot/kernel.hh" ] 4 | kernelfiles = [ "boot/kernel.cc" ] 5 | requires = [ "tag/mode/kernel" ] 6 | provides = [ "symbol/entry_bsp", "symbol/entry_ap", "symbol/sleeping_failed", 7 | "symbol/syscall_entry_cxx", "symbol/irq_entry_user", "symbol/irq_entry_kernel" ] 8 | -------------------------------------------------------------------------------- /kernel/boot/kernelspace-amd64/mcconf.module: -------------------------------------------------------------------------------- 1 | [module.amd64-pc-kernelspace] 2 | incfiles = [ "boot/pagetables.hh", "boot/memory-layout-common.h", "boot/init-kernelspace-common.hh", 3 | "boot/pagetables.cc.m4"] 4 | kernelfiles = [ "boot/pagetables.cc", "boot/init-kernelspace-common.cc"] 5 | 6 | makefile_body = ''' 7 | boot/pagetables.cc: boot/pagetables.cc.m4 8 | m4 boot/pagetables.cc.m4 > boot/pagetables.cc 9 | ''' 10 | -------------------------------------------------------------------------------- /kernel/boot/kmem-common/mcconf.module: -------------------------------------------------------------------------------- 1 | [module.kmem-common] 2 | incfiles = [ "boot/kmem-common.hh" ] 3 | -------------------------------------------------------------------------------- /kernel/boot/kmem-e820/boot/kmem.hh: -------------------------------------------------------------------------------- 1 | /* -*- mode:C++; -*- */ 2 | /* MIT License -- MyThOS: The Many-Threads Operating System 3 | * 4 | * Permission is hereby granted, free of charge, to any person 5 | * obtaining a copy of this software and associated documentation 6 | * files (the "Software"), to deal in the Software without 7 | * restriction, including without limitation the rights to use, copy, 8 | * modify, merge, publish, distribute, sublicense, and/or sell copies 9 | * of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be 13 | * included in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 19 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 20 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | * Copyright 2014 Randolf Rotta, Maik Krüger, and contributors, BTU Cottbus-Senftenberg 25 | */ 26 | #pragma once 27 | 28 | 29 | namespace mythos { 30 | class KernelMemory; 31 | 32 | namespace boot { 33 | 34 | void initKernelMemory(KernelMemory& km); 35 | 36 | } // namespace boot 37 | } // namespace mythos 38 | -------------------------------------------------------------------------------- /kernel/boot/kmem-e820/mcconf.module: -------------------------------------------------------------------------------- 1 | [module.kmem-e820] 2 | incfiles = [ "boot/kmem.hh" ] 3 | kernelfiles = [ "boot/kmem.cc" ] 4 | requires = [ "tag/boot/e820" ] 5 | -------------------------------------------------------------------------------- /kernel/boot/kmem-multiboot/boot/kmem.hh: -------------------------------------------------------------------------------- 1 | /* -*- mode:C++; -*- */ 2 | /* MIT License -- MyThOS: The Many-Threads Operating System 3 | * 4 | * Permission is hereby granted, free of charge, to any person 5 | * obtaining a copy of this software and associated documentation 6 | * files (the "Software"), to deal in the Software without 7 | * restriction, including without limitation the rights to use, copy, 8 | * modify, merge, publish, distribute, sublicense, and/or sell copies 9 | * of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be 13 | * included in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 19 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 20 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | * Copyright 2014 Randolf Rotta, Maik Krüger, and contributors, BTU Cottbus-Senftenberg 25 | */ 26 | #pragma once 27 | 28 | namespace mythos { 29 | class KernelMemory; 30 | 31 | namespace boot { 32 | 33 | void initKernelMemory(KernelMemory& km); 34 | 35 | } // namespace boot 36 | } // namespace mythos 37 | -------------------------------------------------------------------------------- /kernel/boot/kmem-multiboot/mcconf.module: -------------------------------------------------------------------------------- 1 | [module.kmem-multiboot] 2 | incfiles = [ "boot/kmem.hh" ] 3 | kernelfiles = [ "boot/kmem.cc" ] 4 | requires = [ "tag/boot/multiboot", "symbol/_mboot_table", "symbol/_mboot_magic" ] 5 | -------------------------------------------------------------------------------- /kernel/boot/kmem-sfi/boot/kmem.hh: -------------------------------------------------------------------------------- 1 | /* -*- mode:C++; -*- */ 2 | /* MIT License -- MyThOS: The Many-Threads Operating System 3 | * 4 | * Permission is hereby granted, free of charge, to any person 5 | * obtaining a copy of this software and associated documentation 6 | * files (the "Software"), to deal in the Software without 7 | * restriction, including without limitation the rights to use, copy, 8 | * modify, merge, publish, distribute, sublicense, and/or sell copies 9 | * of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be 13 | * included in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 19 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 20 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | * Copyright 2014 Randolf Rotta, Maik Krüger, and contributors, BTU Cottbus-Senftenberg 25 | */ 26 | #pragma once 27 | 28 | 29 | namespace mythos { 30 | class KernelMemory; 31 | 32 | namespace boot { 33 | 34 | void initKernelMemory(KernelMemory& km); 35 | 36 | } // namespace boot 37 | } // namespace mythos 38 | -------------------------------------------------------------------------------- /kernel/boot/kmem-sfi/mcconf.module: -------------------------------------------------------------------------------- 1 | [module.kmem-sfi] 2 | incfiles = [ "boot/kmem.hh" ] 3 | kernelfiles = [ "boot/kmem.cc" ] 4 | requires = [ "tag/boot/sfi" ] 5 | -------------------------------------------------------------------------------- /kernel/boot/memory-root/boot/memory-root.hh: -------------------------------------------------------------------------------- 1 | /* -*- mode:C++; indent-tabs-mode:nil; -*- */ 2 | /* MIT License -- MyThOS: The Many-Threads Operating System 3 | * 4 | * Permission is hereby granted, free of charge, to any person 5 | * obtaining a copy of this software and associated documentation 6 | * files (the "Software"), to deal in the Software without 7 | * restriction, including without limitation the rights to use, copy, 8 | * modify, merge, publish, distribute, sublicense, and/or sell copies 9 | * of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be 13 | * included in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 19 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 20 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | * Copyright 2016 Randolf Rotta, Robert Kuban, and contributors, BTU Cottbus-Senftenberg 25 | */ 26 | #pragma once 27 | 28 | #include 29 | 30 | namespace mythos { 31 | class DeviceMemory; 32 | class KernelMemory; 33 | class CapEntry; 34 | 35 | namespace boot { 36 | 37 | DeviceMemory* device_memory_root(); 38 | CapEntry& device_memory_root_entry(); 39 | KernelMemory* kmem_root(); 40 | CapEntry* kmem_root_entry(); 41 | 42 | void initMemoryRegions(); 43 | } // namespace boot 44 | } // namespace mythos 45 | -------------------------------------------------------------------------------- /kernel/boot/memory-root/mcconf.module: -------------------------------------------------------------------------------- 1 | [module.memory-root] 2 | incfiles = [ "boot/memory-root.hh" ] 3 | kernelfiles = [ "boot/memory-root.cc" ] 4 | -------------------------------------------------------------------------------- /kernel/build/cxxabi-kernel/mcconf.module: -------------------------------------------------------------------------------- 1 | # -*- mode:toml; -*- 2 | [module.cxxabi-kernel] 3 | incfiles = [ "util/stl/stdexcept", "util/stl/string", "util/stl/cstring", "util/stl/bits/stdlib-float.h", "util/stl/bits/std_abs.h"] 4 | # disabled because of conflict with application modules, included by compiler modules 5 | # provides = [ "cstring", "cstdint", "cstddef", "algorithm", "stdexcept", "string", "atomic", "utility", "array", "new", "type_traits", "bits/stl_algobase.h", "cstdlib", "cstdarg" ] 6 | provides = [ "tag/cxxabi-kernel" ] 7 | kernelfiles = [ "util/cxxsupport.cc", "util/string.cc", "util/cxxdelete.cc" ] 8 | makefile_head = ''' 9 | KERNEL_CPPFLAGS += -Iutil/stl 10 | ''' 11 | -------------------------------------------------------------------------------- /kernel/build/cxxabi-kernel/util/cxxdelete.cc: -------------------------------------------------------------------------------- 1 | /* -*- mode:C++; -*- */ 2 | /* MIT License -- MyThOS: The Many-Threads Operating System 3 | * 4 | * Permission is hereby granted, free of charge, to any person 5 | * obtaining a copy of this software and associated documentation 6 | * files (the "Software"), to deal in the Software without 7 | * restriction, including without limitation the rights to use, copy, 8 | * modify, merge, publish, distribute, sublicense, and/or sell copies 9 | * of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be 13 | * included in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 19 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 20 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | * Copyright 2014 Randolf Rotta, Maik Krüger, and contributors, BTU Cottbus-Senftenberg 25 | */ 26 | 27 | #include "util/assert.hh" 28 | 29 | void operator delete(void* /*ptr*/) noexcept(true) { 30 | PANIC_MSG(false, "generic operator delete() called"); 31 | } 32 | 33 | void operator delete[](void* ptr) noexcept(true) { 34 | return operator delete(ptr); 35 | } 36 | -------------------------------------------------------------------------------- /kernel/build/cxxabi-kernel/util/stl/bits/std_abs.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // dummy header to get rid of the convoluted STL includes 4 | -------------------------------------------------------------------------------- /kernel/build/cxxabi-kernel/util/stl/bits/stdlib-float.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // dummy header to get rid of the convoluted STL float includes 4 | -------------------------------------------------------------------------------- /kernel/build/cxxabi-kernel/util/stl/cstring: -------------------------------------------------------------------------------- 1 | /* -*- mode:C++; -*- */ 2 | /* MIT License -- MyThOS: The Many-Threads Operating System 3 | * 4 | * Permission is hereby granted, free of charge, to any person 5 | * obtaining a copy of this software and associated documentation 6 | * files (the "Software"), to deal in the Software without 7 | * restriction, including without limitation the rights to use, copy, 8 | * modify, merge, publish, distribute, sublicense, and/or sell copies 9 | * of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be 13 | * included in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 19 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 20 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | * Copyright 2014 Randolf Rotta, Maik Krüger, and contributors, BTU Cottbus-Senftenberg 25 | */ 26 | 27 | #include // for size_t 28 | 29 | extern "C" void* memcpy(void* dst, void const* src, size_t count); 30 | extern "C" void* memmove(void *dest, const void *src, size_t n); 31 | extern "C" void* memset(void* dst, int value, size_t count); 32 | extern "C" size_t strlen(const char *s); 33 | extern "C" int strcmp(const char *s1, const char *s2); 34 | -------------------------------------------------------------------------------- /kernel/build/cxxabi-kernel/util/stl/stdexcept: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // dummy header to get rid of the dependency from stdexcept to std::string 4 | -------------------------------------------------------------------------------- /kernel/build/cxxabi-kernel/util/stl/string: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // dummy header to get rid of the convoluted STL string includes 4 | -------------------------------------------------------------------------------- /kernel/build/doxygen/doxygen/namespaces.dox: -------------------------------------------------------------------------------- 1 | /** 2 | @namespace mythos 3 | The main namespace for all code from the mythos project. 4 | */ 5 | 6 | /** 7 | @namespace mythos::x86 8 | Processor specific functions like control registers and Model Specific Registers 9 | for the ia32, x86, x86-64 and amd64 architectures. 10 | 11 | see also: 12 | - http://www.etallen.com/cpuid.html 13 | - https://software.intel.com/en-us/articles/intel-64-architecture-processor-topology-enumeration 14 | - http://malekb.free.fr/Detecting%20Multi-Core%20Processor%20Topology%20in%20an%20IA-32%20Platform.pdf 15 | - http://support.amd.com/TechDocs/25481.pdf 16 | */ 17 | 18 | /** 19 | @namespace mythos::cpu 20 | Classes and functions that are used to manage the processor and 21 | abstract processor specific details where possible. 22 | */ 23 | 24 | /** 25 | @namespace mythos::async 26 | Communication support for asynchronous objects based on Tasklets, Monitors and Places. 27 | */ 28 | 29 | 30 | /** 31 | @namespace mlog 32 | The debug output and tracing subsystem that is used by the mythos 33 | kernel. It was developed during the MyThOS project but is probably 34 | very useful for other projects. 35 | */ 36 | -------------------------------------------------------------------------------- /kernel/build/doxygen/mcconf.module: -------------------------------------------------------------------------------- 1 | # -*- mode:toml; -*- 2 | [module.doxygen] 3 | incfiles = [ "Doxyfile", "doxygen/namespaces.dox" ] 4 | makefile_body = ''' 5 | doc: Doxyfile 6 | doxygen 7 | ''' 8 | -------------------------------------------------------------------------------- /kernel/build/emu-bochs-amd64/mako_bochs.rc: -------------------------------------------------------------------------------- 1 | ata0: enabled=1, ioaddr1=0x1f0, ioaddr2=0x3f0, irq=14 2 | ata0-master: type=cdrom, path=boot.iso, status=inserted 3 | com1: enabled=1, mode=file, dev=bochs-out.txt 4 | com2: enabled=1, mode=socket-client, dev=localhost:8888 5 | com3: enabled=1, mode=file, dev=mythos.trace 6 | boot: cdrom 7 | 8 | #cpu: count=1:2:1, quantum=16, cpuid_limit_winnt=0, ignore_bad_msrs=0 9 | cpu: count=1:2:4, ips=4000000, quantum=16, model=corei7_ivy_bridge_3770k, reset_on_triple_fault=1, cpuid_limit_winnt=0, ignore_bad_msrs=0 10 | megs: 1024 11 | 12 | #display_library: x, options="gui_debug" 13 | magic_break: enabled=1 14 | port_e9_hack: enabled=0 15 | 16 | #log: bochs.log 17 | #logprefix: %t%e%d 18 | #debug: action=report 19 | debug_symbols: file=boot.sym 20 | 21 | romimage: file="${vars.mythos_root}/3rdparty/bochs/bios/BIOS-bochs-latest" 22 | vgaromimage: file="${vars.mythos_root}/3rdparty/bochs/bios/VGABIOS-lgpl-latest" 23 | -------------------------------------------------------------------------------- /kernel/build/emu-bochs-amd64/mcconf.module: -------------------------------------------------------------------------------- 1 | # -*- mode:toml; -*- 2 | [module.bochs-emu-amd64] 3 | extrafiles = [ "mako_bochs.rc" ] 4 | requires = [ "boot.iso" ] 5 | provides = [ "tag/emu-bochs", "bochs.rc" ] 6 | 7 | makefile_body = ''' 8 | bochs: boot.iso 9 | ${vars.mythos_root}/3rdparty/bochs/bochs -q -f bochs.rc 10 | ''' 11 | -------------------------------------------------------------------------------- /kernel/build/gcc-host-pc/mcconf.module: -------------------------------------------------------------------------------- 1 | # -*- mode:toml; -*- 2 | [module.gcc-host-pc] 3 | incfiles = [ "util/compiler.hh" ] 4 | requires = [ "tag/platform/pc", "tag/mode/host", "tag/compiler/gcc" ] 5 | provides = [ "string.h", "sys/socket.h", "sys/un.h", "thread", "assert.h", "iostream", "sstream", "sys/stat.h", "sys/types.h", "sys/mman.h", "unistd.h", "cstdio", "fcntl.h", "cstdlib", "cstring", "cstdint", "cstddef", "algorithm", "stdexcept", "string", "atomic", "utility", "array", "new", "type_traits", "bits/stl_algobase.h", "fstream", "unordered_map", "memory", "vector", "ios", "signal.h" ] 6 | 7 | makefile_head = ''' 8 | HOST_CXX = $(CXX) 9 | HOST_AS = $(CXX) 10 | HOST_CPPFLAGS += $(CPPFLAGS) 11 | HOST_CPPFLAGS += -I. 12 | 13 | HOST_CXXFLAGS += $(CXXFLAGS) 14 | HOST_CXXFLAGS += -std=c++11 15 | HOST_CXXFLAGS += -Wno-invalid-offsetof 16 | HOST_CXXFLAGS += -Wall -Wextra -Wstrict-aliasing=3 -Wstrict-overflow=5 -Wsign-compare 17 | # -pedantic is deprecated since gcc4.8, but -Wpedantic is not supported by gcc4.7 18 | HOST_CXXFLAGS += -pedantic 19 | HOST_CXXFLAGS += -Wcast-align -Wlogical-op 20 | HOST_CXXFLAGS += -Wcast-qual -Wconversion -Wuseless-cast 21 | #HOST_CXXFLAGS += -Wstack-usage=512 22 | #HOST_CXXFLAGS += -Wsuggest-attribute=pure -Wsuggest-attribute=const -Wsuggest-attribute=noreturn 23 | 24 | # use -gdwarf-2 in order to avoid gdb bug 25 | # use -gdwarf-2 in order to avoid linker error in gcc4.7 26 | #HOST_CXXFLAGS += -O2 -g3 -ggdb -gdwarf-2 27 | #HOST_CXXFLAGS += -Os -DNDEBUG 28 | HOST_CXXFLAGS += -O2 -g 29 | ''' 30 | -------------------------------------------------------------------------------- /kernel/build/gitignore/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | -------------------------------------------------------------------------------- /kernel/build/gitignore/mcconf.module: -------------------------------------------------------------------------------- 1 | [module.gitignore] 2 | somefiles=['.gitignore'] 3 | -------------------------------------------------------------------------------- /kernel/build/iso-image/boot/isodir/boot/grub/grub.cfg: -------------------------------------------------------------------------------- 1 | set default = "0" 2 | set timeout=1 3 | menuentry "mythos" { 4 | multiboot /boot/kernel.elf 5 | } 6 | -------------------------------------------------------------------------------- /kernel/build/iso-image/iso-image.module: -------------------------------------------------------------------------------- 1 | # -*- mode:toml; -*- 2 | [module.iso-image] 3 | incfiles = [ "boot/isodir/boot/grub/grub.cfg" ] 4 | requires = [ "boot32.elf" ] 5 | provides = [ "boot.iso" ] 6 | copy = [ "boot/isodir/boot/grub/grub.cfg" ] 7 | 8 | makefile_body = ''' 9 | boot.iso: boot32.elf 10 | cp boot32.elf boot/isodir/boot/kernel.elf 11 | command -v grub-mkrescue && grub-mkrescue -d /usr/lib/grub/i386-pc -o boot.iso boot/isodir || grub2-mkrescue -d /usr/lib/grub/i386-pc -o boot.iso boot/isodir 12 | ''' 13 | -------------------------------------------------------------------------------- /kernel/cpu/clflush-amd64/cpu/clflush.hh: -------------------------------------------------------------------------------- 1 | /* -*- mode:C++; -*- */ 2 | /* MIT License -- MyThOS: The Many-Threads Operating System 3 | * 4 | * Permission is hereby granted, free of charge, to any person 5 | * obtaining a copy of this software and associated documentation 6 | * files (the "Software"), to deal in the Software without 7 | * restriction, including without limitation the rights to use, copy, 8 | * modify, merge, publish, distribute, sublicense, and/or sell copies 9 | * of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be 13 | * included in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 19 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 20 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | * Copyright 2016 Martin Messer, BTU Cottbus-Senftenberg 25 | */ 26 | 27 | #pragma once 28 | 29 | namespace mythos { 30 | namespace cpu { 31 | 32 | enum Const{ 33 | CACHELINESIZE=64 34 | }; 35 | 36 | inline void clflush(void* addr){ 37 | asm volatile("clflush (%0)"::"r"(addr)); 38 | } 39 | 40 | inline void wbinvd(){ 41 | asm volatile("wbinvd" ::: "memory"); 42 | } 43 | 44 | } // namespace cpu 45 | } // namespace mythos 46 | -------------------------------------------------------------------------------- /kernel/cpu/clflush-amd64/mcconf.module: -------------------------------------------------------------------------------- 1 | [module.clflush-amd64] 2 | incfiles= [ "cpu/clflush.hh" ] 3 | requires= [ "tag/cpu/clflush" ] 4 | -------------------------------------------------------------------------------- /kernel/cpu/clflush-knc/mcconf.module: -------------------------------------------------------------------------------- 1 | [module.clflush-knc] 2 | incfiles = [ "cpu/clflush.hh" ] 3 | requires = [ "tag/cpu/clevict" ] 4 | -------------------------------------------------------------------------------- /kernel/cpu/core-local-memory/cpu/CoreLocal.cc: -------------------------------------------------------------------------------- 1 | /* -*- mode:C++; -*- */ 2 | /* MIT License -- MyThOS: The Many-Threads Operating System 3 | * 4 | * Permission is hereby granted, free of charge, to any person 5 | * obtaining a copy of this software and associated documentation 6 | * files (the "Software"), to deal in the Software without 7 | * restriction, including without limitation the rights to use, copy, 8 | * modify, merge, publish, distribute, sublicense, and/or sell copies 9 | * of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be 13 | * included in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 19 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 20 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | * Copyright 2014 Randolf Rotta, Maik Krüger, and contributors, BTU Cottbus-Senftenberg 25 | */ 26 | 27 | #include "cpu/CoreLocal.hh" 28 | 29 | namespace mythos { 30 | 31 | size_t KernelCLM::blockSize; 32 | size_t KernelCLM::offset KERNEL_CLM_HOT; 33 | 34 | } // namespace mythos 35 | -------------------------------------------------------------------------------- /kernel/cpu/core-local-memory/mcconf.module: -------------------------------------------------------------------------------- 1 | [module.core-local-memory] 2 | incfiles = [ "cpu/CoreLocal.hh" ] 3 | kernelfiles = [ "cpu/CoreLocal.cc" ] 4 | -------------------------------------------------------------------------------- /kernel/cpu/ctrlregs-amd64/mcconf.module: -------------------------------------------------------------------------------- 1 | [module.amd64-cpu-regs] 2 | incfiles = [ "cpu/ctrlregs.hh", "cpu/fpuregs.hh" ] 3 | -------------------------------------------------------------------------------- /kernel/cpu/fpu-amd64/mcconf.module: -------------------------------------------------------------------------------- 1 | [module.amd64-cpu-fpu] 2 | incfiles = [ "cpu/fpu.hh" ] 3 | kernelfiles = [ "cpu/fpu.cc" ] 4 | 5 | -------------------------------------------------------------------------------- /kernel/cpu/hwthreadid/cpu/hwthreadid.cc: -------------------------------------------------------------------------------- 1 | /* -*- mode:C++; -*- */ 2 | /* MIT License -- MyThOS: The Many-Threads Operating System 3 | * 4 | * Permission is hereby granted, free of charge, to any person 5 | * obtaining a copy of this software and associated documentation 6 | * files (the "Software"), to deal in the Software without 7 | * restriction, including without limitation the rights to use, copy, 8 | * modify, merge, publish, distribute, sublicense, and/or sell copies 9 | * of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be 13 | * included in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 19 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 20 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | * Copyright 2014 Randolf Rotta, Maik Krüger, Maximilian Heyne, and contributors, BTU Cottbus-Senftenberg 25 | */ 26 | #include "cpu/hwthreadid.hh" 27 | 28 | namespace mythos { 29 | namespace cpu { 30 | size_t hwThreadCount = 0; 31 | CoreLocal hwThreadID_ KERNEL_CLM_HOT; 32 | } // namespace cpu 33 | } // namespace mythos 34 | -------------------------------------------------------------------------------- /kernel/cpu/hwthreadid/mcconf.module: -------------------------------------------------------------------------------- 1 | [module.kernel-threadid] 2 | incfiles = [ "cpu/hwthreadid.hh" ] 3 | kernelfiles = [ "cpu/hwthreadid.cc" ] 4 | -------------------------------------------------------------------------------- /kernel/cpu/hwthreadpause-amd64/mcconf.module: -------------------------------------------------------------------------------- 1 | [module.thread-pause-amd64] 2 | incfiles = [ "cpu/hwthread_pause.hh" ] 3 | requires = [ "tag/cpu/pause" ] 4 | -------------------------------------------------------------------------------- /kernel/cpu/hwthreadpause-delay/mcconf.module: -------------------------------------------------------------------------------- 1 | [module.thread-pause-delay] 2 | incfiles = [ "cpu/hwthread_pause.hh" ] 3 | requires = [ "tag/cpu/delay" ] 4 | -------------------------------------------------------------------------------- /kernel/cpu/idle-hlt/cpu/idle_lowlevel.S: -------------------------------------------------------------------------------- 1 | /* -*- mode:asm; indent-tabs-mode:nil -*- */ 2 | /* MIT License -- MyThOS: The Many-Threads Operating System 3 | * 4 | * Permission is hereby granted, free of charge, to any person 5 | * obtaining a copy of this software and associated documentation 6 | * files (the "Software"), to deal in the Software without 7 | * restriction, including without limitation the rights to use, copy, 8 | * modify, merge, publish, distribute, sublicense, and/or sell copies 9 | * of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be 13 | * included in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 19 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 20 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | * Copyright 2016 Randolf Rotta, Robert Kuban, Maik Krüger, and contributors, BTU Cottbus-Senftenberg 25 | */ 26 | 27 | .extern kernel_stack 28 | .extern sleeping_failed 29 | 30 | .global cpu_idle_halt 31 | .type cpu_idle_halt, @function 32 | cpu_idle_halt: 33 | mov %gs:kernel_stack, %rsp // start on a clean stack to avoid filling it up 34 | pushq $0 // fake return address 35 | pushq $0 // fake rbp, end for stack unwinding 36 | sti 37 | hlt 38 | cli 39 | xor %rbp, %rbp 40 | pushq $0 // fake return address 41 | jmp sleeping_failed 42 | -------------------------------------------------------------------------------- /kernel/cpu/idle-hlt/mcconf.module: -------------------------------------------------------------------------------- 1 | # -*- mode:toml; -*- 2 | [module.kernel-idle-hlt] 3 | incfiles = [ "cpu/idle.hh" ] 4 | kernelfiles = [ "cpu/idle_lowlevel.S" ] 5 | requires = [ "symbol/sleeping_failed" ] 6 | -------------------------------------------------------------------------------- /kernel/cpu/idle-knc/cpu/idle_lowlevel.S: -------------------------------------------------------------------------------- 1 | /* -*- mode:asm; indent-tabs-mode:nil -*- */ 2 | /* MIT License -- MyThOS: The Many-Threads Operating System 3 | * 4 | * Permission is hereby granted, free of charge, to any person 5 | * obtaining a copy of this software and associated documentation 6 | * files (the "Software"), to deal in the Software without 7 | * restriction, including without limitation the rights to use, copy, 8 | * modify, merge, publish, distribute, sublicense, and/or sell copies 9 | * of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be 13 | * included in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 19 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 20 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | * Copyright 2016 Randolf Rotta, Robert Kuban, Maik Krüger, and contributors, BTU Cottbus-Senftenberg 25 | */ 26 | 27 | .extern kernel_stack 28 | .extern sleeping_failed 29 | 30 | .global cpu_idle_halt 31 | .type cpu_idle_halt, @function 32 | cpu_idle_halt: 33 | mov %gs:kernel_stack, %rsp // start on a clean stack to avoid filling it up 34 | pushq $0 // fake return address 35 | pushq $0 // fake rbp, end for stack unwinding 36 | sti 37 | hlt 38 | cli 39 | xor %rbp, %rbp 40 | pushq $0 // fake return address 41 | jmp sleeping_failed 42 | -------------------------------------------------------------------------------- /kernel/cpu/idle-knc/mcconf.module: -------------------------------------------------------------------------------- 1 | # -*- mode:toml; -*- 2 | [module.kernel-idle-knc] 3 | incfiles = [ "cpu/idle.hh" ] 4 | kernelfiles = [ "cpu/idle_lowlevel.S", "cpu/idle.cc" ] 5 | requires = [ "symbol/sleeping_failed", "tag/platform/knc" ] 6 | -------------------------------------------------------------------------------- /kernel/cpu/ioapic-amd64/mcconf.module: -------------------------------------------------------------------------------- 1 | # -*- mode:toml; -*- 2 | [module.ioapic-amd64] 3 | incfiles = [ "cpu/IOApic.hh" ] 4 | kernelfiles = [ "cpu/IOApicAmd64.cc" ] 5 | requires = [ "tag/cpu/amd64ioapic" ] 6 | -------------------------------------------------------------------------------- /kernel/cpu/ioapic-kncapic/mcconf.module: -------------------------------------------------------------------------------- 1 | # -*- mode:toml; -*- 2 | [module.ioapic-knc] 3 | incfiles = ["cpu/IOApic.hh", "cpu/sbox.hh" ] 4 | kernelfiles = [ "cpu/IOApicKNC.cc" ] 5 | requires = [ "tag/cpu/kncioapic" ] 6 | -------------------------------------------------------------------------------- /kernel/cpu/ioapic/mcconf.module: -------------------------------------------------------------------------------- 1 | # -*- mode:toml; -*- 2 | [module.ioapic] 3 | incfiles = [ "cpu/IOApicDef.hh" ] 4 | -------------------------------------------------------------------------------- /kernel/cpu/kernel-bug-amd64/cpu/IrqHandler.hh: -------------------------------------------------------------------------------- 1 | /* -*- mode:C++; -*- */ 2 | /* MIT License -- MyThOS: The Many-Threads Operating System 3 | * 4 | * Permission is hereby granted, free of charge, to any person 5 | * obtaining a copy of this software and associated documentation 6 | * files (the "Software"), to deal in the Software without 7 | * restriction, including without limitation the rights to use, copy, 8 | * modify, merge, publish, distribute, sublicense, and/or sell copies 9 | * of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be 13 | * included in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 19 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 20 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | * Copyright 2014 Randolf Rotta, Maik Krüger, and contributors, BTU Cottbus-Senftenberg 25 | */ 26 | #pragma once 27 | 28 | #include "cpu/kernel_entry.hh" 29 | 30 | namespace mythos { 31 | 32 | template 33 | class IIrqHandler 34 | { 35 | public: 36 | virtual void process(ARGS...) = 0; 37 | }; 38 | 39 | extern IIrqHandler* irq_kernelbugs[32]; 40 | 41 | bool handle_bugirqs(cpu::KernelIRQFrame* ctx); 42 | 43 | } // namespace mythos 44 | -------------------------------------------------------------------------------- /kernel/cpu/kernel-bug-amd64/mcconf.module: -------------------------------------------------------------------------------- 1 | # -*- mode:toml; -*- 2 | [module.kernel-bug-amd64] 3 | incfiles = [ "cpu/IrqHandler.hh" ] 4 | kernelfiles = [ "cpu/IrqHandler.cc" ] 5 | -------------------------------------------------------------------------------- /kernel/cpu/kernel-entry-amd64/mcconf.module: -------------------------------------------------------------------------------- 1 | # -*- mode:toml; -*- 2 | [module.kernel-entry-amd64] 3 | incfiles = [ "cpu/kernel_entry.hh", "cpu/thread-state-layout.h", 4 | "cpu/IdtAmd64.hh", "cpu/IRQDescriptorAmd64.hh" ] 5 | kernelfiles = [ "cpu/irq_entry.S", "cpu/syscall_entry.S", "cpu/kernel_entry.cc", 6 | "cpu/IdtAmd64.cc" ] 7 | requires = [ "symbol/irq_entry_kernel" ] 8 | 9 | -------------------------------------------------------------------------------- /kernel/cpu/lapic-kncapic/mcconf.module: -------------------------------------------------------------------------------- 1 | # -*- mode:toml; -*- 2 | [module.lapic-kncapic] 3 | incfiles = [ "cpu/LAPICdef.hh" ] 4 | requires = [ "tag/cpu/kncapic" ] 5 | -------------------------------------------------------------------------------- /kernel/cpu/lapic-xapic/mcconf.module: -------------------------------------------------------------------------------- 1 | # -*- mode:toml; -*- 2 | [module.lapic-xapic] 3 | incfiles = [ "cpu/LAPICdef.hh" ] 4 | requires = [ "tag/cpu/xapic" ] 5 | -------------------------------------------------------------------------------- /kernel/cpu/lapic/mcconf.module: -------------------------------------------------------------------------------- 1 | # -*- mode:toml; -*- 2 | [module.lapic] 3 | incfiles = [ "cpu/LAPIC.hh" ] 4 | kernelfiles = [ "cpu/LAPIC.cc" ] 5 | requires = [ "tag/cpu/xapic" ] 6 | -------------------------------------------------------------------------------- /kernel/cpu/mlog-serial/cpu/MLogSinkSerial.cc: -------------------------------------------------------------------------------- 1 | /* -*- mode:C++; -*- */ 2 | /* MIT License -- MyThOS: The Many-Threads Operating System 3 | * 4 | * Permission is hereby granted, free of charge, to any person 5 | * obtaining a copy of this software and associated documentation 6 | * files (the "Software"), to deal in the Software without 7 | * restriction, including without limitation the rights to use, copy, 8 | * modify, merge, publish, distribute, sublicense, and/or sell copies 9 | * of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be 13 | * included in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 19 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 20 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | * Copyright 2014 Randolf Rotta, Maik Krüger, and contributors, BTU Cottbus-Senftenberg 25 | */ 26 | 27 | #include "cpu/MLogSinkSerial.hh" 28 | #include "cpu/hwthreadid.hh" 29 | #include "util/ostream.hh" 30 | 31 | namespace mythos { 32 | 33 | void MLogSinkSerial::write(char const* msg, size_t length) { 34 | auto id = cpu::getThreadID(); 35 | mutex << [this,msg,length,id]() { 36 | mythos::ostream_base io(&this->serial); 37 | io << id << ": "; 38 | io.write(msg, length); 39 | io << "\n"; 40 | io.flush(); 41 | }; 42 | } 43 | 44 | } // namespace mythos 45 | -------------------------------------------------------------------------------- /kernel/cpu/mlog-serial/mcconf.module: -------------------------------------------------------------------------------- 1 | # -*- mode:toml; -*- 2 | [module.mlog-serial] 3 | incfiles = [ "cpu/MLogSinkSerial.hh" ] 4 | kernelfiles = [ "cpu/MLogSinkSerial.cc" ] 5 | -------------------------------------------------------------------------------- /kernel/cpu/performance-monitoring-amd64/mcconf.module: -------------------------------------------------------------------------------- 1 | [module.amd64-cpu-perf-mon] 2 | incfiles = [ "cpu/perfmon.hh", "cpu/perfmondefs.hh" ] 3 | -------------------------------------------------------------------------------- /kernel/cpu/pic/mcconf.module: -------------------------------------------------------------------------------- 1 | # -*- mode:toml; -*- 2 | [module.pic-disable-x86] 3 | incfiles = [ "cpu/PIC.hh" ] 4 | -------------------------------------------------------------------------------- /kernel/cpu/segments-amd64/cpu/gdt-layout.h: -------------------------------------------------------------------------------- 1 | /* -*- mode:C++; -*- */ 2 | /* MIT License -- MyThOS: The Many-Threads Operating System 3 | * 4 | * Permission is hereby granted, free of charge, to any person 5 | * obtaining a copy of this software and associated documentation 6 | * files (the "Software"), to deal in the Software without 7 | * restriction, including without limitation the rights to use, copy, 8 | * modify, merge, publish, distribute, sublicense, and/or sell copies 9 | * of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be 13 | * included in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 19 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 20 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | * Copyright 2014 Randolf Rotta, Maik Krüger, and contributors, BTU Cottbus-Senftenberg 25 | */ 26 | #pragma once 27 | 28 | #define SEGMENT_KERNEL_CS 0x10 29 | #define SEGMENT_KERNEL_DS 0x18 30 | #define SEGMENT_USER_CS32 0x20 31 | #define SEGMENT_USER_DS 0x28 32 | #define SEGMENT_USER_CS 0x30 33 | #define SEGMENT_KERNEL_FS 0x38 34 | #define SEGMENT_KERNEL_GS 0x40 35 | #define SEGMENT_KERNEL_TSS 0x48 36 | -------------------------------------------------------------------------------- /kernel/cpu/segments-amd64/mcconf.module: -------------------------------------------------------------------------------- 1 | # -*- mode:toml; -*- 2 | [module.segments-amd64] 3 | incfiles = [ "cpu/SegmentDescriptor.hh", "cpu/tss64.hh" ] 4 | 5 | [module.segments-gdt-amd64] 6 | incfiles = [ "cpu/gdt-layout.h", "cpu/GdtAmd64.hh" ] 7 | -------------------------------------------------------------------------------- /kernel/cpu/serial-port/mcconf.module: -------------------------------------------------------------------------------- 1 | [module.serial-port] 2 | incfiles = [ "cpu/SerialPort.hh", "cpu/SerialStreamBuf.hh" ] 3 | -------------------------------------------------------------------------------- /kernel/cpu/stacktrace/mcconf.module: -------------------------------------------------------------------------------- 1 | [module.stacktrace] 2 | requires = [ "tag/cpu/amd64" ] 3 | incfiles = [ "cpu/stacktrace.hh" ] 4 | makefile_head = ''' 5 | # http://blog.reverberate.org/2013/05/deep-wizardry-stack-unwinding.html 6 | KERNEL_CXXFLAGS += -fno-omit-frame-pointer 7 | ''' 8 | -------------------------------------------------------------------------------- /kernel/cpu/x2apic/mcconf.module: -------------------------------------------------------------------------------- 1 | # -*- mode:toml; -*- 2 | [module.local-x2apic] 3 | incfiles = [ "cpu/LAPIC.hh" ] 4 | kernelfiles = [ "cpu/LAPIC.cc" ] 5 | requires = [ "tag/cpu/x2apic" ] 6 | -------------------------------------------------------------------------------- /kernel/host/host-common/mcconf.module: -------------------------------------------------------------------------------- 1 | # -*- mode:toml; -*- 2 | [module.host-common] 3 | incfiles = [ "util/PhysPtr.hh", "util/assert.hh", "util/FDSender.hh", "util/FDReceiver.hh" ] 4 | requires = [ "tag/mode/host" ] 5 | -------------------------------------------------------------------------------- /kernel/host/host-common/util/assert.hh: -------------------------------------------------------------------------------- 1 | /* -*- mode:C++; indent-tabs-mode:nil; -*- */ 2 | /* MIT License -- MyThOS: The Many-Threads Operating System 3 | * 4 | * Permission is hereby granted, free of charge, to any person 5 | * obtaining a copy of this software and associated documentation 6 | * files (the "Software"), to deal in the Software without 7 | * restriction, including without limitation the rights to use, copy, 8 | * modify, merge, publish, distribute, sublicense, and/or sell copies 9 | * of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be 13 | * included in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 19 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 20 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | * Copyright 2016 Randolf Rotta, Robert Kuban, and contributors, BTU Cottbus-Senftenberg 25 | */ 26 | #pragma once 27 | 28 | // note: the mythos host should not depend on the implementation in base/assert.cc 29 | // but we can add host/assert.cc one day... 30 | #include 31 | #define ASSERT(expr) assert(expr) 32 | #define ASSERT_MSG(expr, message) assert(expr) 33 | #define OOPS(expr) assert(expr) 34 | #define OOPS_MSG(expr, message) assert(expr) 35 | #define PANIC(expr) assert(expr) 36 | #define PANIC_MSG(expr, message) assert(expr) 37 | -------------------------------------------------------------------------------- /kernel/host/init-channel/mcconf.module: -------------------------------------------------------------------------------- 1 | # -*- mode:toml; -*- 2 | [module.host-init-channel] 3 | incfiles = [ "host/InitChannel.hh" ] 4 | hostfiles = [ "host/InitChannel.cc" ] 5 | -------------------------------------------------------------------------------- /kernel/host/pci-memaccess/mcconf.module: -------------------------------------------------------------------------------- 1 | # -*- mode:toml; -*- 2 | [module.host-pci-memaccess] 3 | incfiles = [ "host/IMemMapper.hh", "host/MemMapperPci.hh", "host/MemAccess.hh" ] 4 | hostfiles = [ "host/MemMapperPci.cc" ] 5 | -------------------------------------------------------------------------------- /kernel/host/xmicterm/mcconf.module: -------------------------------------------------------------------------------- 1 | # -*- mode:toml; -*- 2 | [module.host-xmicterm] 3 | xmictermfiles = [ "host/xmicterm.cc" ] 4 | provides = [ "xmicterm" ] 5 | 6 | makefile_head = ''' 7 | TARGETS += xmicterm 8 | 9 | # disable features which might require runtime support we don't have 10 | XMICTERM_CXX = $(HOST_CXX) 11 | XMICTERM_CXXFLAGS = $(HOST_CXXFLAGS) 12 | XMICTERM_CPPFLAGS = $(HOST_CPPFLAGS) 13 | ''' 14 | makefile_body = ''' 15 | xmicterm: $(XMICTERMFILES_OBJ) $(HOSTFILES_OBJ) 16 | $(XMICTERM_CXX) $(HOST_LFLAGS) $(XMICTERM_CXXFLAGS) -pthread -o $@ $(XMICTERMFILES_OBJ) $(HOSTFILES_OBJ) 17 | ''' 18 | -------------------------------------------------------------------------------- /kernel/mythos/caps/mcconf.module: -------------------------------------------------------------------------------- 1 | # -*- mode:toml; -*- 2 | [module.mythos-caps] 3 | incfiles = [ "mythos/caps.hh" ] 4 | -------------------------------------------------------------------------------- /kernel/mythos/caps/mythos/caps.hh: -------------------------------------------------------------------------------- 1 | /* -*- mode:C++; -*- */ 2 | /* MIT License -- MyThOS: The Many-Threads Operating System 3 | * 4 | * Permission is hereby granted, free of charge, to any person 5 | * obtaining a copy of this software and associated documentation 6 | * files (the "Software"), to deal in the Software without 7 | * restriction, including without limitation the rights to use, copy, 8 | * modify, merge, publish, distribute, sublicense, and/or sell copies 9 | * of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be 13 | * included in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 19 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 20 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | * Copyright 2016 Randolf Rotta, Robert Kuban, and contributors, BTU Cottbus-Senftenberg 25 | */ 26 | #pragma once 27 | 28 | #include 29 | #include "util/bitfield.hh" 30 | 31 | namespace mythos { 32 | 33 | typedef uint64_t CapRequest; 34 | typedef uint32_t CapPtr; 35 | typedef uint8_t CapPtrDepth; 36 | typedef uint64_t CapValue; 37 | typedef uint32_t CapData; 38 | typedef uint32_t CapObj; 39 | constexpr CapPtr null_cap = 0; 40 | constexpr CapPtr delete_cap = CapPtr(-2); 41 | constexpr CapPtrDepth max_cap_depth = 32; 42 | 43 | } // namespace mythos 44 | -------------------------------------------------------------------------------- /kernel/mythos/error/mcconf.module: -------------------------------------------------------------------------------- 1 | # -*- mode:toml; -*- 2 | [module.mythos-error] 3 | incfiles = [ "mythos/Error.hh" ] 4 | -------------------------------------------------------------------------------- /kernel/mythos/host-info-table-knc/mcconf.module: -------------------------------------------------------------------------------- 1 | # -*- mode:toml; -*- 2 | [module.host-info-table-knc] 3 | incfiles = [ "mythos/HostInfoTable.hh" ] 4 | -------------------------------------------------------------------------------- /kernel/mythos/infoFrame/mcconf.module: -------------------------------------------------------------------------------- 1 | # -*- mode:toml; -*- 2 | [module.mythos-info-frame] 3 | incfiles = [ "mythos/InfoFrame.hh" ] 4 | -------------------------------------------------------------------------------- /kernel/mythos/init/mcconf.module: -------------------------------------------------------------------------------- 1 | # -*- mode:toml; -*- 2 | [module.mythos-init] 3 | incfiles = [ "mythos/init.hh" ] 4 | -------------------------------------------------------------------------------- /kernel/mythos/invocation/mcconf.module: -------------------------------------------------------------------------------- 1 | # -*- mode:toml; -*- 2 | [module.mythos-invocationBuffer] 3 | incfiles = [ 4 | "mythos/InvocationBuf.hh", 5 | "mythos/KEvent.hh", 6 | "mythos/syscall.hh", 7 | "mythos/invocation.hh", 8 | "mythos/protocol/common.hh", 9 | "mythos/protocol/KernelObject.hh", 10 | "mythos/protocol/ExecutionContext.hh", 11 | "mythos/protocol/PageMap.hh", 12 | "mythos/protocol/Frame.hh", 13 | "mythos/protocol/KernelMemory.hh", 14 | "mythos/protocol/Example.hh", 15 | "mythos/protocol/CapMap.hh", 16 | "mythos/protocol/Portal.hh", 17 | "mythos/protocol/InterruptControl.hh", 18 | ] 19 | -------------------------------------------------------------------------------- /kernel/mythos/invocation/mythos/invocation.hh: -------------------------------------------------------------------------------- 1 | /* -*- mode:C++; indent-tabs-mode:nil; -*- */ 2 | /* MIT License -- MyThOS: The Many-Threads Operating System 3 | * 4 | * Permission is hereby granted, free of charge, to any person 5 | * obtaining a copy of this software and associated documentation 6 | * files (the "Software"), to deal in the Software without 7 | * restriction, including without limitation the rights to use, copy, 8 | * modify, merge, publish, distribute, sublicense, and/or sell copies 9 | * of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be 13 | * included in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 19 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 20 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | * Copyright 2016 Randolf Rotta, Robert Kuban, and contributors, BTU Cottbus-Senftenberg 25 | */ 26 | #pragma once 27 | 28 | #include "mythos/protocol/common.hh" 29 | #include "mythos/protocol/KernelObject.hh" 30 | #include "mythos/protocol/Example.hh" 31 | #include "mythos/protocol/ExecutionContext.hh" 32 | #include "mythos/protocol/KernelMemory.hh" 33 | #include "mythos/protocol/CapMap.hh" 34 | #include "mythos/protocol/Portal.hh" 35 | #include "mythos/protocol/Frame.hh" 36 | #include "mythos/protocol/PageMap.hh" 37 | #include "mythos/syscall.hh" 38 | 39 | -------------------------------------------------------------------------------- /kernel/mythos/pci-mpsc-queue/mcconf.module: -------------------------------------------------------------------------------- 1 | # -*- mode:toml; -*- 2 | [module.mythos-pci-mpsc-queue] 3 | incfiles = [ "mythos/PciMsgQueueMPSC.hh" ] 4 | -------------------------------------------------------------------------------- /kernel/objects/capability-spinning/mcconf.module: -------------------------------------------------------------------------------- 1 | # -*- mode:toml; -*- 2 | 3 | [module.capability-spinning] 4 | requires = [ "tag/cap/spinning" ] 5 | incfiles = [ 6 | "objects/CapEntry.hh", 7 | "objects/RevokeOperation.hh", 8 | ] 9 | kernelfiles = [ 10 | "objects/RevokeOperation.cc", 11 | "objects/CapEntry.cc", 12 | ] 13 | -------------------------------------------------------------------------------- /kernel/objects/capability-utils/mcconf.module: -------------------------------------------------------------------------------- 1 | # -*- mode:toml; -*- 2 | 3 | [module.capability-utils] 4 | incfiles = [ 5 | "objects/CapRef.hh", 6 | "objects/ops.hh", 7 | "objects/DeleteBroadcast.hh", 8 | "objects/TypedCap.hh", 9 | ] 10 | kernelfiles = [ 11 | "objects/CapRef.cc", 12 | "objects/ops.cc", 13 | "objects/DeleteBroadcast.cc", 14 | ] -------------------------------------------------------------------------------- /kernel/objects/capmap/mcconf.module: -------------------------------------------------------------------------------- 1 | # -*- mode:toml; -*- 2 | 3 | [module.objects-capmap] 4 | incfiles = [ "objects/CapMap.hh" ] 5 | kernelfiles = [ "objects/CapMap.cc" ] 6 | -------------------------------------------------------------------------------- /kernel/objects/common/mcconf.module: -------------------------------------------------------------------------------- 1 | # -*- mode:toml; -*- 2 | 3 | [module.objects-common] 4 | incfiles = [ 5 | "objects/IAllocator.hh", 6 | "objects/IPortal.hh", 7 | "objects/IFrame.hh", 8 | "objects/IPageMap.hh", 9 | "objects/ISchedulable.hh", 10 | "objects/ISignalable.hh", 11 | "objects/IDeleter.hh", 12 | "objects/IInvocation.hh", 13 | "objects/IFactory.hh", 14 | "objects/ICapMap.hh", 15 | "objects/IScheduler.hh", 16 | "objects/signal.hh", 17 | "objects/kevent.hh", 18 | "objects/Cap.hh", 19 | "objects/IKernelObject.hh", 20 | "objects/DebugMessage.hh", 21 | "objects/mlog.hh", 22 | ] 23 | kernelfiles = [ 24 | "objects/ISchedulable.cc", 25 | "objects/DebugMessage.cc", 26 | "objects/mlog.cc", 27 | ] 28 | -------------------------------------------------------------------------------- /kernel/objects/common/objects/DebugMessage.hh: -------------------------------------------------------------------------------- 1 | /* -*- mode:C++; indent-tabs-mode:nil; -*- */ 2 | /* MIT License -- MyThOS: The Many-Threads Operating System 3 | * 4 | * Permission is hereby granted, free of charge, to any person 5 | * obtaining a copy of this software and associated documentation 6 | * files (the "Software"), to deal in the Software without 7 | * restriction, including without limitation the rights to use, copy, 8 | * modify, merge, publish, distribute, sublicense, and/or sell copies 9 | * of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be 13 | * included in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 19 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 20 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | * Copyright 2016 Randolf Rotta, Robert Kuban, and contributors, BTU Cottbus-Senftenberg 25 | */ 26 | #pragma once 27 | 28 | #include "mythos/protocol/KernelObject.hh" 29 | #include "mythos/Error.hh" 30 | #include "objects/Cap.hh" 31 | 32 | namespace mythos { 33 | 34 | class IInvocation; 35 | 36 | Error writeDebugInfo(const char* name, Cap self, IInvocation* msg); 37 | 38 | } 39 | -------------------------------------------------------------------------------- /kernel/objects/common/objects/IDeleter.hh: -------------------------------------------------------------------------------- 1 | /* -*- mode:C++; indent-tabs-mode:nil; -*- */ 2 | /* MIT License -- MyThOS: The Many-Threads Operating System 3 | * 4 | * Permission is hereby granted, free of charge, to any person 5 | * obtaining a copy of this software and associated documentation 6 | * files (the "Software"), to deal in the Software without 7 | * restriction, including without limitation the rights to use, copy, 8 | * modify, merge, publish, distribute, sublicense, and/or sell copies 9 | * of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be 13 | * included in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 19 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 20 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | * Copyright 2016 Randolf Rotta, Robert Kuban, and contributors, BTU Cottbus-Senftenberg 25 | */ 26 | #pragma once 27 | 28 | #include "util/optional.hh" 29 | #include "async/IResult.hh" 30 | #include "util/LinkedList.hh" 31 | 32 | namespace mythos { 33 | 34 | class CapEntry; 35 | class IKernelObject; 36 | 37 | class IDeleter 38 | { 39 | public: 40 | typedef LinkedList::Queueable handle_t; 41 | virtual ~IDeleter() {} 42 | virtual void deleteObject(handle_t& obj) = 0; 43 | virtual optional deleteEntry(CapEntry&) = 0; 44 | }; 45 | 46 | } // namespace mythos 47 | 48 | -------------------------------------------------------------------------------- /kernel/objects/common/objects/ISchedulable.cc: -------------------------------------------------------------------------------- 1 | /* -*- mode:C++; indent-tabs-mode:nil; -*- */ 2 | /* MIT License -- MyThOS: The Many-Threads Operating System 3 | * 4 | * Permission is hereby granted, free of charge, to any person 5 | * obtaining a copy of this software and associated documentation 6 | * files (the "Software"), to deal in the Software without 7 | * restriction, including without limitation the rights to use, copy, 8 | * modify, merge, publish, distribute, sublicense, and/or sell copies 9 | * of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be 13 | * included in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 19 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 20 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | * Copyright 2016 Randolf Rotta, Robert Kuban, and contributors, BTU Cottbus-Senftenberg 25 | */ 26 | #include "objects/ISchedulable.hh" 27 | 28 | namespace mythos { 29 | CoreLocal> current_ec; 30 | } // namespace mythos 31 | -------------------------------------------------------------------------------- /kernel/objects/common/objects/ISignalable.hh: -------------------------------------------------------------------------------- 1 | /* -*- mode:C++; indent-tabs-mode:nil; -*- */ 2 | /* MIT License -- MyThOS: The Many-Threads Operating System 3 | * 4 | * Permission is hereby granted, free of charge, to any person 5 | * obtaining a copy of this software and associated documentation 6 | * files (the "Software"), to deal in the Software without 7 | * restriction, including without limitation the rights to use, copy, 8 | * modify, merge, publish, distribute, sublicense, and/or sell copies 9 | * of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be 13 | * included in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 19 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 20 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | * Copyright 2016 Randolf Rotta, Robert Kuban, and contributors, BTU Cottbus-Senftenberg 25 | */ 26 | #pragma once 27 | 28 | #include "cpu/CoreLocal.hh" 29 | #include 30 | 31 | namespace mythos { 32 | 33 | class ISignalable 34 | { 35 | public: 36 | virtual ~ISignalable() {} 37 | 38 | virtual optional signal(CapData data) = 0; 39 | }; 40 | 41 | 42 | } // namespace mythos 43 | -------------------------------------------------------------------------------- /kernel/objects/common/objects/mlog.cc: -------------------------------------------------------------------------------- 1 | /* -*- mode:C++; -*- */ 2 | /* MIT License -- MyThOS: The Many-Threads Operating System 3 | * 4 | * Permission is hereby granted, free of charge, to any person 5 | * obtaining a copy of this software and associated documentation 6 | * files (the "Software"), to deal in the Software without 7 | * restriction, including without limitation the rights to use, copy, 8 | * modify, merge, publish, distribute, sublicense, and/or sell copies 9 | * of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be 13 | * included in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 19 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 20 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | * Copyright 2014 Randolf Rotta, Maik Krüger, and contributors, BTU Cottbus-Senftenberg 25 | */ 26 | 27 | #include "objects/mlog.hh" 28 | 29 | namespace mlog { 30 | Logger cap("cap"); 31 | Logger sched("sched"); 32 | Logger syscall("syscall"); 33 | Logger ec("ec"); 34 | Logger km("km"); 35 | Logger irq("irq"); 36 | Logger perfmon("perfmon"); 37 | Logger pm("pm"); //processor management 38 | } // namespace mlog 39 | -------------------------------------------------------------------------------- /kernel/objects/cpudriver-knc/mcconf.module: -------------------------------------------------------------------------------- 1 | # -*- mode:toml; -*- 2 | [module.objects-cpudriver-knc] 3 | incfiles = [ "objects/CpuDriverKNC.hh", "mythos/protocol/CpuDriverKNC.hh" ] 4 | kernelfiles = [ "objects/CpuDriverKNC.cc" ] 5 | 6 | [module.plugin-cpudriver-knc] 7 | kernelfiles = [ "objects/PluginCpuDriverKNC.cc" ] 8 | -------------------------------------------------------------------------------- /kernel/objects/example/mcconf.module: -------------------------------------------------------------------------------- 1 | # -*- mode:toml; -*- 2 | 3 | [module.objects_example] 4 | incfiles = [ "objects/Example.hh" ] 5 | kernelfiles = [ "objects/Example.cc" ] 6 | -------------------------------------------------------------------------------- /kernel/objects/execution-context/mcconf.module: -------------------------------------------------------------------------------- 1 | # -*- mode:toml; -*- 2 | [module.objects-execution-context] 3 | incfiles = [ "objects/ExecutionContext.hh" ] 4 | kernelfiles = [ "objects/ExecutionContext.cc" ] 5 | -------------------------------------------------------------------------------- /kernel/objects/interrupt-control/mcconf.module: -------------------------------------------------------------------------------- 1 | # -*- mode:toml; -*- 2 | [module.objects-interrupt-control] 3 | incfiles = [ "objects/InterruptControl.hh" ] 4 | kernelfiles = [ "objects/InterruptControl.cc" ] 5 | -------------------------------------------------------------------------------- /kernel/objects/kernel-memory/mcconf.module: -------------------------------------------------------------------------------- 1 | # -*- mode:toml; -*- 2 | [module.objects-kernel-memory] 3 | incfiles = [ "objects/KernelMemory.hh" ] 4 | kernelfiles = [ "objects/KernelMemory.cc" ] 5 | -------------------------------------------------------------------------------- /kernel/objects/memory-amd64/mcconf.module: -------------------------------------------------------------------------------- 1 | # -*- mode:toml; -*- 2 | 3 | [module.objects-memory-amd64] 4 | incfiles = [ 5 | "objects/FrameDataAmd64.hh", 6 | "objects/MemoryRegion.hh", 7 | "objects/PageMapAmd64.hh", 8 | "objects/PML4InvalidationBroadcastAmd64.hh", 9 | "objects/DeviceMemory.hh" 10 | ] 11 | kernelfiles = [ 12 | "objects/MemoryRegion.cc", 13 | "objects/PageMapAmd64.cc", 14 | "objects/PML4InvalidationBroadcastAmd64.cc", 15 | "objects/DeviceMemory.cc" 16 | ] 17 | -------------------------------------------------------------------------------- /kernel/objects/portal/mcconf.module: -------------------------------------------------------------------------------- 1 | # -*- mode:toml; -*- 2 | 3 | [module.objects-portal] 4 | incfiles = [ "objects/Portal.hh" ] 5 | kernelfiles = [ "objects/Portal.cc" ] 6 | -------------------------------------------------------------------------------- /kernel/objects/processor-allocator/mcconf.module: -------------------------------------------------------------------------------- 1 | # -*- mode:toml; -*- 2 | [module.plugin-processor-allocator] 3 | incfiles = [ "objects/PluginProcessorAllocator.hh", "objects/ProcessorAllocator.hh", "mythos/protocol/ProcessorAllocator.hh" ] 4 | kernelfiles = [ "objects/ProcessorAllocator.cc", "objects/PluginProcessorAllocator.cc"] 5 | 6 | -------------------------------------------------------------------------------- /kernel/objects/processor-allocator/objects/PluginProcessorAllocator.cc: -------------------------------------------------------------------------------- 1 | /* -*- mode:C++; indent-tabs-mode:nil; -*- */ 2 | /* MIT License -- MyThOS: The Many-Threads Operating System 3 | * 4 | * Permission is hereby granted, free of charge, to any person 5 | * obtaining a copy of this software and associated documentation 6 | * files (the "Software"), to deal in the Software without 7 | * restriction, including without limitation the rights to use, copy, 8 | * modify, merge, publish, distribute, sublicense, and/or sell copies 9 | * of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be 13 | * included in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 19 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 20 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | * Copyright 2020 Philipp Gypser and contributors, BTU Cottbus-Senftenberg 25 | */ 26 | 27 | #include "objects/PluginProcessorAllocator.hh" 28 | 29 | mythos::PluginProcessorAllocator pluginProcessorAllocator; 30 | mythos::PluginProcessorAllocatorActivator pluginProcessorAllocatorActivator; 31 | 32 | -------------------------------------------------------------------------------- /kernel/objects/rapl-driver-intel/mcconf.module: -------------------------------------------------------------------------------- 1 | # -*- mode:toml; -*- 2 | [module.objects-rapl-driver-intel] 3 | incfiles = [ "objects/RaplDriverIntel.hh", "mythos/protocol/RaplDriverIntel.hh", "mythos/protocol/RaplVal.hh" ] 4 | kernelfiles = [ "objects/RaplDriverIntel.cc" ] 5 | 6 | [module.plugin-rapl-driver-intel] 7 | kernelfiles = [ "objects/PluginRaplDriverIntel.cc" ] 8 | -------------------------------------------------------------------------------- /kernel/objects/scheduling-context/mcconf.module: -------------------------------------------------------------------------------- 1 | # -*- mode:toml; -*- 2 | [module.objects-scheduling-context] 3 | incfiles = [ "objects/SchedulingContext.hh" ] 4 | kernelfiles = [ "objects/SchedulingContext.cc" ] 5 | -------------------------------------------------------------------------------- /kernel/objects/signal-listener/mcconf.module: -------------------------------------------------------------------------------- 1 | # -*- mode:toml; -*- 2 | 3 | [module.objects_signal_listener] 4 | incfiles = [ 5 | "objects/SignalListener.hh", 6 | "mythos/protocol/SignalListener.hh", 7 | "runtime/SignalListener.hh", 8 | ] 9 | kernelfiles = [ "objects/SignalListener.cc" ] 10 | -------------------------------------------------------------------------------- /kernel/plugins/common/mcconf.module: -------------------------------------------------------------------------------- 1 | [module.plugin-common] 2 | incfiles = [ "plugins/Plugin.hh", "plugins/TestPlugin.hh" ] 3 | kernelfiles = [ "plugins/Plugin.cc" ] 4 | -------------------------------------------------------------------------------- /kernel/plugins/dump-multiboot/mcconf.module: -------------------------------------------------------------------------------- 1 | [module.plugin-dump-multiboot] 2 | kernelfiles = [ "plugins/dump_multiboot.cc" ] 3 | requires = [ "symbol/_mboot_table", "symbol/_mboot_magic" ] 4 | -------------------------------------------------------------------------------- /kernel/plugins/invocation-mock/mcconf.module: -------------------------------------------------------------------------------- 1 | # -*- mode:toml; -*- 2 | 3 | [module.invocation-mock] 4 | incfiles = [ 5 | "plugins/InvocationMock.hh", 6 | ] 7 | -------------------------------------------------------------------------------- /kernel/plugins/test-caps/mcconf.module: -------------------------------------------------------------------------------- 1 | [module.plugin-test-caps] 2 | incfiles = [ "plugins/test-caps.hh" ] 3 | kernelfiles = [ "plugins/test-caps.cc" ] 4 | -------------------------------------------------------------------------------- /kernel/plugins/test-mem/mcconf.module: -------------------------------------------------------------------------------- 1 | [module.plugin-test-mem] 2 | incfiles = [ "plugins/test-mem.hh" ] 3 | kernelfiles = [ "plugins/test-mem.cc" ] 4 | -------------------------------------------------------------------------------- /kernel/plugins/test-perfmon/mcconf.module: -------------------------------------------------------------------------------- 1 | [module.plugin-test-perfmon] 2 | incfiles = [ "plugins/test-perfmon.hh" ] 3 | kernelfiles = [ "plugins/test-perfmon.cc" ] 4 | -------------------------------------------------------------------------------- /kernel/plugins/test-perfmon/plugins/test-perfmon.hh: -------------------------------------------------------------------------------- 1 | /* -*- mode:C++; indent-tabs-mode:nil; -*- */ 2 | /* MIT License -- MyThOS: The Many-Threads Operating System 3 | * 4 | * Permission is hereby granted, free of charge, to any person 5 | * obtaining a copy of this software and associated documentation 6 | * files (the "Software"), to deal in the Software without 7 | * restriction, including without limitation the rights to use, copy, 8 | * modify, merge, publish, distribute, sublicense, and/or sell copies 9 | * of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be 13 | * included in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 19 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 20 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | * Copyright 2021 Philipp Gypser, BTU Cottbus-Senftenberg 25 | */ 26 | #pragma once 27 | 28 | #include "plugins/TestPlugin.hh" 29 | 30 | namespace mythos { 31 | namespace test_perfmon { 32 | 33 | class TestPerfMon : public TestPlugin 34 | { 35 | public: 36 | TestPerfMon(); 37 | virtual void initThread(cpu::ThreadID threadID) override; 38 | virtual void initGlobal() override; 39 | 40 | private: 41 | void runTest(); 42 | }; 43 | 44 | } // test_perfmon 45 | } // mythos 46 | -------------------------------------------------------------------------------- /kernel/plugins/test-places/mcconf.module: -------------------------------------------------------------------------------- 1 | # -*- mode:toml; -*- 2 | [module.plugin-test-places] 3 | kernelfiles = [ "plugins/test-places.cc" ] 4 | -------------------------------------------------------------------------------- /kernel/runtime/async/mcconf.module: -------------------------------------------------------------------------------- 1 | [module.runtime-async] 2 | incfiles = [ "runtime/ISysretHandler.hh", "runtime/FutureBase.hh", 3 | "runtime/PortalBase.hh", "runtime/Tasklet.hh" ] 4 | appfiles = [ "runtime/FutureBase.cc" ] 5 | -------------------------------------------------------------------------------- /kernel/runtime/cga/mcconf.module: -------------------------------------------------------------------------------- 1 | # -*- mode:toml; -*- 2 | [module.cga] 3 | incfiles = [ "runtime/cgaAttr.hh", "runtime/cgaScreen.hh", "runtime/cgaChar.hh" ] 4 | appfiles = [ "runtime/cgaScreen.cc" ] 5 | -------------------------------------------------------------------------------- /kernel/runtime/cga/runtime/cgaChar.hh: -------------------------------------------------------------------------------- 1 | /* -*- mode:C++; indent-tabs-mode:nil; -*- */ 2 | /* MIT License -- MyThOS: The Many-Threads Operating System 3 | * 4 | * Permission is hereby granted, free of charge, to any person 5 | * obtaining a copy of this software and associated documentation 6 | * files (the "Software"), to deal in the Software without 7 | * restriction, including without limitation the rights to use, copy, 8 | * modify, merge, publish, distribute, sublicense, and/or sell copies 9 | * of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be 13 | * included in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 19 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 20 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | * Copyright 2020 Philipp Gypser and contributors, BTU Cottbus-Senftenberg 25 | */ 26 | #pragma once 27 | 28 | #include "runtime/cgaAttr.hh" 29 | 30 | namespace mythos{ 31 | 32 | class CgaChar { 33 | 34 | public: 35 | void setChar(char c) { this->value = c; } 36 | 37 | char getChar() { return this->value; } 38 | 39 | void setAttr(const CgaAttr& attr) { this->attr = attr; } 40 | 41 | CgaAttr getAttr() { return this-> attr; } 42 | 43 | private: 44 | char value; 45 | CgaAttr attr; 46 | }; 47 | 48 | 49 | } // namespace mythos 50 | -------------------------------------------------------------------------------- /kernel/runtime/crt-init/mcconf.module: -------------------------------------------------------------------------------- 1 | # -*- mode:toml; -*- 2 | [module.app-common] 3 | crtfiles = [ "runtime/start.S", "runtime/crtend.S", "runtime/crtbegin.cc" ] 4 | provides = [ "crtbegin" ] 5 | requires = [ "runtime/cxxsupport.cc", "runtime/DebugSink.cc" ] 6 | 7 | makefile_head = ''' 8 | INITAPP_CXX ?= $(APP_CXX) 9 | INITAPP_AS ?= $(APP_AS) 10 | INITAPP_CXXFLAGS += $(APP_CXXFLAGS) 11 | INITAPP_CPPFLAGS += $(APP_CPPFLAGS) 12 | INITAPP_CXXFLAGS += -fno-stack-protector 13 | INITAPP_ASFLAGS += $(APP_ASFLAGS) 14 | 15 | CRT_CXX = $(APP_CXX) 16 | CRT_AS = $(APP_AS) 17 | CRT_CXXFLAGS += $(APP_CXXFLAGS) 18 | CRT_CPPFLAGS += $(APP_CPPFLAGS) 19 | CRT_CXXFLAGS += -fno-stack-protector 20 | CRT_ASFLAGS += $(APP_ASFLAGS) 21 | ''' 22 | -------------------------------------------------------------------------------- /kernel/runtime/crt-init/runtime/crtend.S: -------------------------------------------------------------------------------- 1 | /* -*- mode:asm; indent-tabs-mode:nil; -*- */ 2 | /* MIT License -- MyThOS: The Many-Threads Operating System 3 | * 4 | * Permission is hereby granted, free of charge, to any person 5 | * obtaining a copy of this software and associated documentation 6 | * files (the "Software"), to deal in the Software without 7 | * restriction, including without limitation the rights to use, copy, 8 | * modify, merge, publish, distribute, sublicense, and/or sell copies 9 | * of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be 13 | * included in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 19 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 20 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | * Copyright 2016 Randolf Rotta, Robert Kuban, and contributors, BTU Cottbus-Senftenberg 25 | */ 26 | 27 | .section .init 28 | pop %rbp 29 | ret 30 | 31 | .section .fini 32 | pop %rbp 33 | ret 34 | 35 | .section .ctors 36 | .global _ctors_end 37 | _ctors_end: 38 | .quad 0 39 | 40 | .section .dtors 41 | .global _dtors_end 42 | _dtors_end: 43 | .quad 0 44 | -------------------------------------------------------------------------------- /kernel/runtime/cxx-headers/mcconf.module: -------------------------------------------------------------------------------- 1 | # -*- mode:toml; -*- 2 | [module.cxx-headers-app] 3 | incfiles = [ "runtime/cxx-includes-test.hh" ] 4 | requires = [ "tag/libcxx" ] 5 | provides = [ 6 | "cstdlib", 7 | "csignal", 8 | "csetjmp", 9 | "cstdarg", 10 | # "typeinfo", 11 | # "typeindex", 12 | "type_traits", 13 | "bitset", 14 | "functional", 15 | "utility", 16 | "ctime", 17 | "chrono", 18 | "cstddef", 19 | "initializer_list", 20 | "tuple", 21 | "new", 22 | "memory", 23 | "scoped_allocator", 24 | "climits", 25 | "cfloat", 26 | "cstdint", 27 | "cinttypes", 28 | "limits", 29 | "exception", 30 | "stdexcept", 31 | "cassert", 32 | "system_error", 33 | "cerrno", 34 | "cctype", 35 | "cwctype", 36 | "cstring", 37 | "cwchar", 38 | # "cuchar", 39 | "string", 40 | "array", 41 | "vector", 42 | "deque", 43 | "list", 44 | "forward_list", 45 | "set", 46 | "map", 47 | "unordered_set", 48 | "unordered_map", 49 | "stack", 50 | "queue", 51 | "iterator", 52 | "algorithm", 53 | "cmath", 54 | "complex", 55 | "valarray", 56 | "random", 57 | "numeric", 58 | "ratio", 59 | "cfenv", 60 | "locale", 61 | "clocale", 62 | "codecvt", 63 | "iosfwd", 64 | "ios", 65 | "istream", 66 | "ostream", 67 | "iostream", 68 | "fstream", 69 | "sstream", 70 | "iomanip", 71 | "streambuf", 72 | "cstdio", 73 | "regex", 74 | "atomic", 75 | "thread", 76 | "mutex", 77 | "future", 78 | "condition_variable" 79 | ] 80 | -------------------------------------------------------------------------------- /kernel/runtime/cxx-headers/runtime/cxx-includes-test.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #warning C++11 include test included, may lead to excessive compilation times 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | //#include 10 | //#include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | //#include 38 | #include 39 | #include 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include 45 | #include 46 | #include 47 | #include 48 | #include 49 | #include 50 | #include 51 | #include 52 | #include 53 | #include 54 | #include 55 | #include 56 | #include 57 | #include 58 | #include 59 | #include 60 | #include 61 | #include 62 | #include 63 | #include 64 | #include 65 | #include 66 | #include 67 | #include 68 | #include 69 | #include 70 | #include 71 | #include 72 | #include 73 | #include 74 | #include 75 | #include 76 | #include 77 | #include 78 | -------------------------------------------------------------------------------- /kernel/runtime/cxx/mcconf.module: -------------------------------------------------------------------------------- 1 | # -*- mode:toml; -*- 2 | [module.cxxabi-app] 3 | incfiles = [ "runtime/futex.hh" ] 4 | appfiles = [ "runtime/cxxsupport.cc", "runtime/pthread.cc", "runtime/futex.cc" ] 5 | provides = [ 6 | "tag/libc", "tag/libcxx", 7 | "bits/alltypes.h", "endian.h" 8 | ] 9 | makefile_head = ''' 10 | APP_CPPFLAGS += -nostdinc -nostdinc++ -isystem ${vars.cxx_path}/include/c++/v1 -isystem ${vars.cxx_path}/include 11 | APP_LDFLAGS += -Wl,--eh-frame-hdr --sysroot=${vars.cxx_path}/../ 12 | APP_LIBS += ${vars.cxx_path}/lib/libomp.a ${vars.cxx_path}/lib/libc++.a ${vars.cxx_path}/lib/libc++abi.a ${vars.cxx_path}/lib/libunwind.a ${vars.cxx_path}/lib/libc.a -lgcc 13 | ''' 14 | -------------------------------------------------------------------------------- /kernel/runtime/kobject/mcconf.module: -------------------------------------------------------------------------------- 1 | [module.runtime-kobject] 2 | incfiles = [ 3 | "runtime/ExecutionContext.hh", 4 | "runtime/CapMap.hh", 5 | "runtime/Example.hh", 6 | "runtime/Frame.hh", 7 | "runtime/PageMap.hh", 8 | "runtime/Portal.hh", 9 | "runtime/KernelMemory.hh", 10 | "runtime/SimpleCapAlloc.hh", 11 | "runtime/CapAlloc.hh", 12 | "runtime/InterruptControl.hh", 13 | "runtime/RaplDriverIntel.hh", 14 | "runtime/ProcessorAllocator.hh" 15 | ] 16 | -------------------------------------------------------------------------------- /kernel/runtime/kobject/runtime/CapAlloc.hh: -------------------------------------------------------------------------------- 1 | /* -*- mode:C++; indent-tabs-mode:nil; -*- */ 2 | /* MIT License -- MyThOS: The Many-Threads Operating System 3 | * 4 | * Permission is hereby granted, free of charge, to any person 5 | * obtaining a copy of this software and associated documentation 6 | * files (the "Software"), to deal in the Software without 7 | * restriction, including without limitation the rights to use, copy, 8 | * modify, merge, publish, distribute, sublicense, and/or sell copies 9 | * of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be 13 | * included in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 19 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 20 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | * Copyright 2020 Philipp Gypser and contributors, BTU Cottbus-Senftenberg 25 | */ 26 | #pragma once 27 | 28 | #include "runtime/SimpleCapAlloc.hh" 29 | 30 | typedef mythos::SimpleCapAlloc< mythos::init::APP_CAP_START, 31 | mythos::init::SIZE-mythos::init::APP_CAP_START> cap_alloc_t; 32 | extern cap_alloc_t capAlloc; 33 | -------------------------------------------------------------------------------- /kernel/runtime/memory/mcconf.module: -------------------------------------------------------------------------------- 1 | [module.runtime-memory] 2 | incfiles = [ "runtime/brk.hh", "runtime/tls.hh", 3 | "runtime/SequentialHeap.hh", "runtime/umem.hh" ] 4 | appfiles = [ "runtime/umem.cc", "runtime/brk.cc", "runtime/tls.cc" ] 5 | 6 | makefile_body = ''' 7 | sequentialHeap: 8 | $(eval APP_CXXFLAGS += -DUSE_SEQUENTIAL_HEAP) 9 | ''' 10 | -------------------------------------------------------------------------------- /kernel/runtime/memory/runtime/brk.cc: -------------------------------------------------------------------------------- 1 | #include "runtime/brk.hh" 2 | #include 3 | 4 | namespace mythos { 5 | 6 | namespace { 7 | ALIGNED(64) std::array bss; 8 | uint64_t idx = 0; 9 | } 10 | 11 | void* sbrk(uint64_t size) { 12 | ASSERT(idx + size < bss.size()); 13 | if (size == 0) return &bss[idx]; 14 | auto old = &bss[idx]; 15 | idx += size; 16 | return (void*)old; 17 | } 18 | 19 | } // namespace mythos -------------------------------------------------------------------------------- /kernel/runtime/memory/runtime/brk.hh: -------------------------------------------------------------------------------- 1 | /* -*- mode:C++; indent-tabs-mode:nil; -*- */ 2 | /* MIT License -- MyThOS: The Many-Threads Operating System 3 | * 4 | * Permission is hereby granted, free of charge, to any person 5 | * obtaining a copy of this software and associated documentation 6 | * files (the "Software"), to deal in the Software without 7 | * restriction, including without limitation the rights to use, copy, 8 | * modify, merge, publish, distribute, sublicense, and/or sell copies 9 | * of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be 13 | * included in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 19 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 20 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | * Copyright 2017 Randolf Rotta, Robert Kuban, and contributors, BTU Cottbus-Senftenberg 25 | */ 26 | #pragma once 27 | 28 | #include 29 | #include "util/assert.hh" 30 | 31 | namespace mythos { 32 | 33 | void* sbrk(uint64_t size); 34 | 35 | } // namespace mythos 36 | -------------------------------------------------------------------------------- /kernel/runtime/memory/runtime/tls.hh: -------------------------------------------------------------------------------- 1 | /* -*- mode:C++; indent-tabs-mode:nil; -*- */ 2 | /* MIT License -- MyThOS: The Many-Threads Operating System 3 | * 4 | * Permission is hereby granted, free of charge, to any person 5 | * obtaining a copy of this software and associated documentation 6 | * files (the "Software"), to deal in the Software without 7 | * restriction, including without limitation the rights to use, copy, 8 | * modify, merge, publish, distribute, sublicense, and/or sell copies 9 | * of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be 13 | * included in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 19 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 20 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | * Copyright 2017 Randolf Rotta, Robert Kuban, and contributors, BTU Cottbus-Senftenberg 25 | */ 26 | #pragma once 27 | 28 | #include 29 | #include "util/assert.hh" 30 | 31 | 32 | namespace mythos { 33 | 34 | void setupInitialTLS(); 35 | 36 | void* setupNewTLS(); 37 | 38 | } // namespace mythos 39 | -------------------------------------------------------------------------------- /kernel/runtime/mlog/mcconf.module: -------------------------------------------------------------------------------- 1 | [module.runtime-mlog] 2 | appfiles = [ "runtime/DebugSink.cc" ] 3 | 4 | [module.app-mlog] 5 | incfiles = [ "runtime/mlog.hh" ] 6 | initappfiles = [ "runtime/mlog.cc" ] 7 | -------------------------------------------------------------------------------- /kernel/runtime/mlog/runtime/mlog.cc: -------------------------------------------------------------------------------- 1 | /* -*- mode:C++; -*- */ 2 | /* MIT License -- MyThOS: The Many-Threads Operating System 3 | * 4 | * Permission is hereby granted, free of charge, to any person 5 | * obtaining a copy of this software and associated documentation 6 | * files (the "Software"), to deal in the Software without 7 | * restriction, including without limitation the rights to use, copy, 8 | * modify, merge, publish, distribute, sublicense, and/or sell copies 9 | * of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be 13 | * included in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 19 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 20 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | * Copyright 2014 Randolf Rotta, Maik Krüger, and contributors, BTU Cottbus-Senftenberg 25 | */ 26 | 27 | #include "runtime/mlog.hh" 28 | #include "util/error-trace.hh" 29 | 30 | namespace mlog { 31 | Logger app("app"); 32 | Logger throw_error("throw"); 33 | Logger testLog("Test"); 34 | } // namespace mlog 35 | -------------------------------------------------------------------------------- /kernel/runtime/mlog/runtime/mlog.hh: -------------------------------------------------------------------------------- 1 | /* -*- mode:C++; -*- */ 2 | /* MIT License -- MyThOS: The Many-Threads Operating System 3 | * 4 | * Permission is hereby granted, free of charge, to any person 5 | * obtaining a copy of this software and associated documentation 6 | * files (the "Software"), to deal in the Software without 7 | * restriction, including without limitation the rights to use, copy, 8 | * modify, merge, publish, distribute, sublicense, and/or sell copies 9 | * of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be 13 | * included in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 19 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 20 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | * Copyright 2014 Randolf Rotta, Maik Krüger, and contributors, BTU Cottbus-Senftenberg 25 | */ 26 | #pragma once 27 | 28 | #include "util/Logger.hh" 29 | 30 | namespace mlog { 31 | 32 | #ifndef MLOG_APP 33 | #define MLOG_APP FilterAny 34 | #endif 35 | 36 | extern mlog::Logger app; 37 | 38 | } // namespace mlog 39 | -------------------------------------------------------------------------------- /kernel/runtime/omp/mcconf.module: -------------------------------------------------------------------------------- 1 | # -*- mode:toml; -*- 2 | [module.omp-app] 3 | provides = [ "omp.h" ] 4 | requires = [ "tag/libc" ] 5 | makefile_head = ''' 6 | # WARNING: Manual labor required to link OpenMP! 7 | # Linking is sensitive to order! Therefore we can't just add OMP_LIBS to APP_LIBS. 8 | # Please add OMP_LIBS *before* APP_LIBS to your init app's make-rule 9 | OMP_LIBS += ${vars.cxx_path}/lib/libomp.a 10 | ''' 11 | -------------------------------------------------------------------------------- /kernel/runtime/posix-headers/mcconf.module: -------------------------------------------------------------------------------- 1 | # -*- mode:toml; -*- 2 | [module.posix-headers-app] 3 | incfiles = [ "runtime/posix-includes-test.hh" ] 4 | requires = [ "tag/libc" ] 5 | provides = [ 6 | "aio.h", 7 | "arpa/inet.h", 8 | "assert.h", 9 | "complex.h", 10 | "cpio.h", 11 | "ctype.h", 12 | "dirent.h", 13 | "dlfcn.h", 14 | "errno.h", 15 | "fcntl.h", 16 | "fenv.h", 17 | "float.h", 18 | "fmtmsg.h", 19 | "fnmatch.h", 20 | "ftw.h", 21 | "glob.h", 22 | "grp.h", 23 | "iconv.h", 24 | "inttypes.h", 25 | "iso646.h", 26 | "langinfo.h", 27 | "libgen.h", 28 | "limits.h", 29 | "locale.h", 30 | "math.h", 31 | "monetary.h", 32 | "mqueue.h", 33 | # "ndbm.h", 34 | "net/if.h", 35 | "netdb.h", 36 | "netinet/in.h", 37 | "netinet/tcp.h", 38 | "nl_types.h", 39 | "poll.h", 40 | "pthread.h", 41 | "pwd.h", 42 | "regex.h", 43 | "sched.h", 44 | "search.h", 45 | "semaphore.h", 46 | "setjmp.h", 47 | "signal.h", 48 | "spawn.h", 49 | "stdarg.h", 50 | "stdbool.h", 51 | "stddef.h", 52 | "stdint.h", 53 | "stdio.h", 54 | "stdlib.h", 55 | "string.h", 56 | "strings.h", 57 | "stropts.h", 58 | "sys/ipc.h", 59 | "sys/mman.h", 60 | "sys/msg.h", 61 | "sys/resource.h", 62 | "sys/select.h", 63 | "sys/sem.h", 64 | "sys/shm.h", 65 | "sys/socket.h", 66 | "sys/stat.h", 67 | "sys/statvfs.h", 68 | "sys/time.h", 69 | "sys/times.h", 70 | "sys/types.h", 71 | "sys/uio.h", 72 | "sys/un.h", 73 | "sys/utsname.h", 74 | "sys/wait.h", 75 | "syslog.h", 76 | "tar.h", 77 | "termios.h", 78 | "tgmath.h", 79 | "time.h", 80 | # "trace.h", 81 | "ulimit.h", 82 | "unistd.h", 83 | "utime.h", 84 | "utmpx.h", 85 | "wchar.h", 86 | "wctype.h", 87 | "wordexp.h" 88 | ] 89 | -------------------------------------------------------------------------------- /kernel/runtime/process/mcconf.module: -------------------------------------------------------------------------------- 1 | # -*- mode:toml; -*- 2 | [module.process] 3 | incfiles = [ "runtime/process.hh" ] 4 | -------------------------------------------------------------------------------- /kernel/runtime/thread-extra/mcconf.module: -------------------------------------------------------------------------------- 1 | # -*- mode:toml; -*- 2 | [module.thread-extra] 3 | incfiles = [ "runtime/thread-extra.hh" ] 4 | -------------------------------------------------------------------------------- /kernel/runtime/thread-extra/runtime/thread-extra.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "util/assert.hh" 4 | #include "mythos/syscall.hh" 5 | #include "mythos/caps.hh" 6 | #include "runtime/ISysretHandler.hh" 7 | #include 8 | 9 | // functions exposing some more mythos threading functionality 10 | // in a safer way then just using the bare system calls 11 | // naming is designed to go well with pthread library calls 12 | 13 | 14 | inline void mythos_wait() 15 | { 16 | mythos::ISysretHandler::handle(mythos::syscall_wait()); 17 | } 18 | 19 | inline mythos::CapPtr mythos_get_pthread_ec(pthread_t pthread) 20 | { 21 | return mythos::CapPtr(mythos_get_pthread_tid(pthread)); 22 | } 23 | 24 | inline mythos::CapPtr mythos_get_pthread_ec_self() 25 | { 26 | return mythos_get_pthread_ec(pthread_self()); 27 | } 28 | 29 | inline void mythos_signal_pthread(pthread_t pthread) 30 | { 31 | auto result = mythos::syscall_signal(mythos_get_pthread_ec(pthread)); 32 | ASSERT(mythos::Error(result.state) == mythos::Error::SUCCESS); 33 | } 34 | -------------------------------------------------------------------------------- /kernel/util/address/mcconf.module: -------------------------------------------------------------------------------- 1 | # -*- mode:toml; -*- 2 | 3 | [module.util-physptr-kernel] 4 | incfiles = [ "util/PhysPtr.hh" ] 5 | requires = [ "tag/mode/kernel" ] 6 | -------------------------------------------------------------------------------- /kernel/util/alignment/mcconf.module: -------------------------------------------------------------------------------- 1 | # -*- mode:toml; -*- 2 | 3 | [module.utils-alignment] 4 | incfiles = [ "util/align.hh" ] 5 | -------------------------------------------------------------------------------- /kernel/util/assert/mcconf.module: -------------------------------------------------------------------------------- 1 | # -*- mode:toml; -*- 2 | [module.assert] 3 | incfiles = [ "util/assert.hh" ] 4 | kernelfiles = [ "util/assert.cc" ] 5 | appfiles = [ "util/assert-user.cc" ] 6 | -------------------------------------------------------------------------------- /kernel/util/bitfield/mcconf.module: -------------------------------------------------------------------------------- 1 | [module.util-bitfield] 2 | incfiles = [ "util/bitfield.hh" ] 3 | -------------------------------------------------------------------------------- /kernel/util/castable/mcconf.module: -------------------------------------------------------------------------------- 1 | # -*- mode:toml; -*- 2 | [module.util-castable] 3 | incfiles = [ "util/ICastable.hh" ] 4 | -------------------------------------------------------------------------------- /kernel/util/datatypes/mcconf.module: -------------------------------------------------------------------------------- 1 | # -*- mode:toml; -*- 2 | 3 | [module.datatypes] 4 | incfiles = [ "util/VectorMax.hh", "util/BacktrackBuffer.hh", "util/Range.hh", "util/RangeSet.hh" ] 5 | -------------------------------------------------------------------------------- /kernel/util/error-trace/mcconf.module: -------------------------------------------------------------------------------- 1 | # -*- mode:toml; -*- 2 | [module.error-trace] 3 | incfiles = [ "util/error-trace.hh" ] 4 | kernelfiles = [ "util/error-trace.cc" ] 5 | -------------------------------------------------------------------------------- /kernel/util/error-trace/util/error-trace.cc: -------------------------------------------------------------------------------- 1 | /* -*- mode:C++; -*- */ 2 | /* MIT License -- MyThOS: The Many-Threads Operating System 3 | * 4 | * Permission is hereby granted, free of charge, to any person 5 | * obtaining a copy of this software and associated documentation 6 | * files (the "Software"), to deal in the Software without 7 | * restriction, including without limitation the rights to use, copy, 8 | * modify, merge, publish, distribute, sublicense, and/or sell copies 9 | * of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be 13 | * included in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 19 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 20 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | * Copyright 2014 Randolf Rotta, Maik Krüger, and contributors, BTU Cottbus-Senftenberg 25 | */ 26 | #include "util/error-trace.hh" 27 | 28 | namespace mlog { 29 | Logger throw_error("throw"); 30 | } 31 | 32 | -------------------------------------------------------------------------------- /kernel/util/events/mcconf.module: -------------------------------------------------------------------------------- 1 | [module.util-events] 2 | incfiles = [ "util/events.hh" ] 3 | 4 | -------------------------------------------------------------------------------- /kernel/util/first-fit-heap-intrusive/mcconf.module: -------------------------------------------------------------------------------- 1 | # -*- mode:toml; -*- 2 | [module.util-first-fit-heap-intrusive] 3 | incfiles = [ "util/FirstFitHeap.hh" ] 4 | -------------------------------------------------------------------------------- /kernel/util/fnv-1a/mcconf.module: -------------------------------------------------------------------------------- 1 | # -*- mode:toml; -*- 2 | [module.fnv-1a] 3 | incfiles = [ "util/hash.hh" ] 4 | -------------------------------------------------------------------------------- /kernel/util/linked-list/mcconf.module: -------------------------------------------------------------------------------- 1 | # -*- mode:toml; -*- 2 | [module.util-linked-list] 3 | incfiles = [ "util/LinkedList.hh" ] 4 | -------------------------------------------------------------------------------- /kernel/util/mlog-base/mcconf.module: -------------------------------------------------------------------------------- 1 | # -*- mode:toml; -*- 2 | [module.mlog-base] 3 | incfiles = [ "util/Filter.hh", "util/TextMsg.hh", 4 | "util/ISink.hh", "util/TextMsgHelpers.hh", "util/Logger.hh" ] 5 | kernelfiles = [ "util/Logger.cc" ] 6 | -------------------------------------------------------------------------------- /kernel/util/mlog-base/util/ISink.hh: -------------------------------------------------------------------------------- 1 | /* -*- mode:C++; -*- */ 2 | /* MIT License -- MyThOS: The Many-Threads Operating System 3 | * 4 | * Permission is hereby granted, free of charge, to any person 5 | * obtaining a copy of this software and associated documentation 6 | * files (the "Software"), to deal in the Software without 7 | * restriction, including without limitation the rights to use, copy, 8 | * modify, merge, publish, distribute, sublicense, and/or sell copies 9 | * of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be 13 | * included in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 19 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 20 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | * Copyright 2014 Randolf Rotta, Maik Krüger, and contributors, BTU Cottbus-Senftenberg 25 | */ 26 | #pragma once 27 | 28 | #include 29 | 30 | namespace mlog { 31 | 32 | class ISink 33 | { 34 | public: 35 | virtual ~ISink() {} 36 | virtual void write(char const* msg, size_t length) = 0; 37 | virtual void flush() = 0; 38 | }; 39 | 40 | } // namespace mlog 41 | -------------------------------------------------------------------------------- /kernel/util/mlog-base/util/Logger.cc: -------------------------------------------------------------------------------- 1 | /* -*- mode:C++; -*- */ 2 | /* MIT License -- MyThOS: The Many-Threads Operating System 3 | * 4 | * Permission is hereby granted, free of charge, to any person 5 | * obtaining a copy of this software and associated documentation 6 | * files (the "Software"), to deal in the Software without 7 | * restriction, including without limitation the rights to use, copy, 8 | * modify, merge, publish, distribute, sublicense, and/or sell copies 9 | * of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be 13 | * included in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 19 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 20 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | * Copyright 2014 Randolf Rotta, Maik Krüger, and contributors, BTU Cottbus-Senftenberg 25 | */ 26 | 27 | #include "util/Logger.hh" 28 | 29 | namespace mlog { 30 | 31 | class DummySink 32 | : public ISink 33 | { 34 | public: 35 | virtual ~DummySink() {} 36 | virtual void write(char const*, size_t) {} 37 | virtual void writeTrace(char const*, size_t) {}; 38 | virtual void flush() {} 39 | }; 40 | 41 | static DummySink dummySink; 42 | ISink* sink = &dummySink; 43 | 44 | Logger testLog("Test"); 45 | 46 | } // namespace mlog 47 | -------------------------------------------------------------------------------- /kernel/util/optional/mcconf.module: -------------------------------------------------------------------------------- 1 | # -*- mode:toml; -*- 2 | [module.optional] 3 | incfiles = [ "util/optional.hh" ] 4 | -------------------------------------------------------------------------------- /kernel/util/ostream/mcconf.module: -------------------------------------------------------------------------------- 1 | # -*- mode:toml; -*- 2 | [module.ostream] 3 | incfiles = [ 4 | "util/MemStreamBuf.hh", 5 | "util/FixedStreamBuf.hh", 6 | "util/TeeStreamBuf.hh", 7 | "util/ostream.hh", 8 | "util/streambuf.hh"] 9 | -------------------------------------------------------------------------------- /kernel/util/string/mcconf.module: -------------------------------------------------------------------------------- 1 | # -*- mode:toml; -*- 2 | [module.mstring] 3 | incfiles = [ 4 | "util/mstring.hh" 5 | ] -------------------------------------------------------------------------------- /kernel/util/sys-structures/mcconf.module: -------------------------------------------------------------------------------- 1 | # -*- mode:toml; -*- 2 | [module.util-elf64] 3 | incfiles = [ "util/elf64.hh" ] 4 | 5 | [module.util-e820] 6 | incfiles = [ "util/E820.hh" ] 7 | 8 | [module.util-multiboot] 9 | incfiles = [ "util/MultiBoot.hh" ] 10 | 11 | [module.util-sfi] 12 | incfiles = [ "util/SFI.hh" ] 13 | 14 | [module.util-acpi] 15 | incfiles = [ "util/ACPI.hh", "util/ACPIApicTopology.hh" ] 16 | kernelfiles = [ "util/ACPIApicTopology.cc" ] 17 | 18 | [module.util-intelmp] 19 | incfiles = [ "util/MPApicTopology.hh" ] 20 | -------------------------------------------------------------------------------- /kernel/util/tidex-mutex/mcconf.module: -------------------------------------------------------------------------------- 1 | # -*- mode:toml; -*- 2 | [module.util-mutex-tidex] 3 | incfiles = [ "util/TidexMutex.hh" ] 4 | 5 | [module.thread-mutex-tidex] 6 | incfiles = [ "util/ThreadMutex.hh" ] 7 | 8 | [module.user-mutex-tidex] 9 | incfiles = [ "runtime/Mutex.hh" ] 10 | -------------------------------------------------------------------------------- /kernel/util/tidex-mutex/util/ThreadMutex.hh: -------------------------------------------------------------------------------- 1 | /* -*- mode:C++; -*- */ 2 | /* MIT License -- MyThOS: The Many-Threads Operating System 3 | * 4 | * Permission is hereby granted, free of charge, to any person 5 | * obtaining a copy of this software and associated documentation 6 | * files (the "Software"), to deal in the Software without 7 | * restriction, including without limitation the rights to use, copy, 8 | * modify, merge, publish, distribute, sublicense, and/or sell copies 9 | * of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be 13 | * included in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 19 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 20 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | * Copyright 2016 Martin Messer, BTU Cottbus-Senftenberg 25 | */ 26 | 27 | #pragma once 28 | 29 | #include "util/TidexMutex.hh" 30 | #include "cpu/hwthreadid.hh" 31 | 32 | namespace mythos{ 33 | 34 | typedef TidexMutex ThreadMutex; 35 | 36 | } // namespace mythos 37 | -------------------------------------------------------------------------------- /kernel/util/tuple/mcconf.module: -------------------------------------------------------------------------------- 1 | # -*- mode:toml; -*- 2 | [module.util-tuple] 3 | incfiles = [ "util/Tuple.hh", "util/applyTuple.hh", "util/integer_sequence.hh" ] 4 | --------------------------------------------------------------------------------