-
Notifications
You must be signed in to change notification settings - Fork 112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multicore support, new standard library, etc... #287
Open
Woazboat
wants to merge
588
commits into
IAIK:multicore
Choose a base branch
from
Woazboat:multicore
base: multicore
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
588 commits
Select commit
Hold shift + click to select a range
dd0d278
STABS debug info is deprecated in gcc
Woazboat 0749a2b
Replace x86_64 atomic functions with template using builtin
Woazboat c0b7f4a
Move arch independent multicore functions to SMP namespace/class
Woazboat 6c1178c
Silence compiler warnings about executable stacks in assembly files
Woazboat cdbe60d
Export cmake compile commands by default
Woazboat 07b1a89
Conditionally use attribute in klibc new if supported by compiler
Woazboat 78c2294
Set defines to always include int limit macros in klibc header files
Woazboat 3f5a030
Change ArchThreadRegisters forward declaration to match definition as…
Woazboat 2ec6223
Move BootstrapRangeAllocator ctor definition to cpp file
Woazboat 5b3eacb
Move load initrd functions to bootloader module namespace
Woazboat 389bc06
Move system state to separate file, clean up thread state enum + strings
Woazboat 25e29a9
Always print thread list info even if SCHEDULER debug category disabled
Woazboat f2a065e
Minor refactoring of Thread + UserProcess
Woazboat 55efd4f
Change define to enum in scheduler lock
Woazboat 3ff18bd
Add missing getInstructionPointer function for arm
Woazboat 8066961
Convert arm atomics to templates + conditionally use builtins if poss…
Woazboat 48433ac
Fix 32 bit elf parsing for dwarf debug data
Woazboat b653cc4
Update libelfin version used in add-debug utility
Woazboat e1dd64f
Use dwarf-4 debug info everywhere
Woazboat 4c8a6c3
Eliminate 'unknown function' from start of kernel thread backtrace by…
Woazboat dcfe9fd
Compile utils with c++17
Woazboat 6e8ecf4
Move cpu local storage code into separate files
Woazboat c3fd052
Split cpu info class into common base class + derived arch dependent …
Woazboat 5d180a9
Add thread runtime to scheduler debug print
Woazboat fec49ab
Move thread stack top calculation out of function call
Woazboat 687b43d
Fix armv8 timestamp
Woazboat cb70e19
Reduce assert wait time
Woazboat e52d17e
Reduce debug output spam when A_INTERRUPTS enabled
Woazboat 234904e
Improve inter-cpu communication and TLB shootdowns
Woazboat a001153
Deduplicate common x86 ArchMulticore code
Woazboat 53ecfe2
Move arch dependent parts of SMP function call message sending to arc…
Woazboat f5f9338
Synchronize printing of backtrace debug output between cpu cores on a…
Woazboat c83ef31
Load kernel debug info for x86_32 from module similar to x86_64
Woazboat d6814af
Minor cleanup in scheduler
Woazboat c52710a
Rename AtomicMpScQueue push function
Woazboat 97ad621
Add architecture independent timer tick handler
Woazboat 883470c
Fix debug assert in arm exception handler
Woazboat fd0141a
Use system timer + cpu local interrupt controller for arm_rpi2 timer …
Woazboat 11daff7
Re-/Store fsbase on context switch
Woazboat 66e65d5
Fix IntervalSet::erase when interval needs to be split as a result
Woazboat 2d0fe29
Change KMM lock from Spinlock to Mutex
Woazboat d8a41aa
Move thread deschedule code into separate function
Woazboat 32e4c22
Ensure backtrace and kernel panic message are printed consecutively t…
Woazboat f5a4513
Better lock assert info strings
Woazboat 36fb017
Terminate forked process in shell when exec failed
Woazboat 7a752da
Properly handle file offset on read/write error
Woazboat e325d8f
Add strnlen_s to userspace libc
Woazboat e00a15b
Add define for MAP_FIXED mmap flag
Woazboat 7c94690
Add info string for assertion in minixfs readBlocks()
Woazboat 0107bb1
Fix bug in PIC8259 irq masking
Woazboat 485dde3
Common prefix autocompletion for shell
Woazboat 047772d
Fix restoration/use of invalid fsbase on return from interrupt to ker…
Woazboat 952ce66
Fix check whether swapgs is required on interrupt return with error code
Woazboat e72ccbc
Add gcc malloc attributes to new/delete functions
Woazboat e792a2f
Add isHeldBy function to BasicSpinLock
Woazboat 50ed4d4
Print thread TID + address in backtrace
Woazboat f573deb
Optimisation for BlockDeviceInode when read/write size is multiple of…
Woazboat cd2d64b
Print used kernel memory when max kernel heap size reached
Woazboat c11ea6b
Add debugAlways debug print macro that always prints regardless of en…
Woazboat 7a3f15b
Pass call location to MutexLock
Woazboat 1a01690
Use debugAlways for user triggered debug prints and prints on assert
Woazboat 14c25f4
Pass call site location from eastl allocations new to KMM
Woazboat 743eb83
Add fake symbols + stack frame to interrupt handler functions to fix …
Woazboat b09fc03
Fix kprintfd recursion detection
Woazboat 591b3b6
Add nop after enabling interrupts to ensure stack frame is still inta…
Woazboat 7bb3e92
Use per-cpu in_assert flag for assert recursion detection
Woazboat 2408def
Print warning when assert happens in interrupt handler that the asser…
Woazboat 582b8b6
Release assert print lock on assert recursion
Woazboat 953f578
Don't send halt IPI to self on assert just print normal assert debug …
Woazboat 30f38bd
Ensure BasicSpinLock acquire is usable before CLS init
Woazboat 610f5e0
Add debug flag to lock that enables debug prints for chosen locks
Woazboat b8456bd
Remove too fine grained debug prints in ArchMulticore
Woazboat 7524529
Always start QEMU gdbserver
Woazboat b40c471
Move I/O APIC code to separate file
Woazboat 4a36afd
Add cpuid functions + supported feature bitset
Woazboat 2f63b14
Minor style fixes
Woazboat 912ed36
Add templated helper class for model specific registers
Woazboat b349ad3
Define x2APIC registers
Woazboat 73da19b
Lock disk image file while running exe2minixfs
Woazboat 62c8d8f
x2APIC support
Woazboat 59113b8
Use bit_cast
Woazboat 71ff0e4
Type safe register read/write for IoApic
Woazboat 74dc83e
Simplify IoApic redir entry initialization
Woazboat 895708f
Use c++20
Woazboat c815caa
C++20 coroutine support
Woazboat 6df258e
Add cleandisk target
Woazboat 6e4ef22
Replace external tool calls with cmake builtin tools for cross platfo…
Woazboat e6b3b5d
Define setInterrupts function
Woazboat ec46906
Increase kernel heap memory
Woazboat dceb677
Print currentThread address in syscall
Woazboat 410b6c5
Inherit AllocBlockIterator from eastl::iterator
Woazboat 6d4a3e3
Use enum for ACPI MADT table enumeration
Woazboat 3058b4d
Enable APIC mode in IMCR register on APIC init
Woazboat ff278ed
Add source_location
Woazboat 7d00ca5
Add SMP:cpu to get cpu info by id
Woazboat 5224ab4
Add debugAdvanced macro to only output debug info when advanced flag …
Woazboat 341e8b6
Add missing sections to kernel linker script
Woazboat 1e65244
Remove duplicate assert.h header file
Woazboat 144d5c9
Mark hdd image and kernel.dbg files as byproducts for cleanup
Woazboat 9cf7740
Add .clang-format file
Woazboat f51bcfc
Add .clangd lsp server config file
Woazboat 3bfe61a
Add subrange
Woazboat 3085668
Add reverse_view
Woazboat dd9393b
Assert new returns nonnull if dynamic kmm disabled
Woazboat 97f8055
clang compatibility for inttypes.h
Woazboat 9482b37
Minor fixes for cmake files + some range views
Woazboat 72e860b
Fix EASTL iterator operator* return type to work with non reference t…
Woazboat 764186d
Change EASTL config
Woazboat a74a790
Change SMP cpu list to static local variable for automatic initializa…
Woazboat 959ec6b
Revamp irq and device + driver handling
Woazboat 041465e
Fix ATA disk interrupts
Woazboat 769004a
Mark kernel.dbg file as build byproduct
Woazboat 305322a
Rename IoApic
Woazboat 5740d1a
Remove empty header
Woazboat 56d5fdb
Iterator traits member types for transform view iterator
Woazboat 37146fb
Function to get bound device list for specialized drivers
Woazboat d4d8b32
Fix reading of received data in serial port irq handler
Woazboat a59d6c2
Chunk serial port transmit buffer writes
Woazboat 4a12764
Make CharacterDevices Inodes
Woazboat a97b554
Add function to get associated inodes for devices
Woazboat 0f6485c
Extract sector size in exe2minixfs into variable
Woazboat 9cb75c1
Remove vfs lock again
Woazboat 702c87b
Make vsnprintf function available to EASTL for string formatting
Woazboat a98f7d1
Use eastl::to_string for int to string conversion
Woazboat 7d02222
Move MBR definitions out of IDE driver file
Woazboat f7c4afa
Use vector in FIFO instead of manually allocated array
Woazboat 1a7e66b
Make IDEDriver a DeviceDriver + change BDManager to static singleton
Woazboat ae0709f
Refactor IDE driver
Woazboat 22d6848
Allow bus specific driver types + probe registered drivers for compat…
Woazboat 3e27270
Convert ProcessRegistry to static local singleton
Woazboat f25d4db
Convert global file descriptor list instance to static local
Woazboat d47921f
Virtual destructors for console + minor cleanup
Woazboat 790fc85
Thread cleanup + use unique_ptr for thread registers
Woazboat 22299fa
Add -fno-sync-libcalls compiler flag
Woazboat 8f72f29
Use static emulator debugconsole io port instead of ad-hoc outportb i…
Woazboat f2615f2
Always inline io port ops
Woazboat ca3cfe1
Use override where appropriate, remove unnecessary semicolons, etc...
Woazboat 29cce2c
Merge branch 'master' into multicore
Woazboat 5794f79
Use C++ attributes + remove unnecessary typedefs in x86_64 paging-def…
Woazboat 125351d
Add more default IDE controller ports
Woazboat f6f9ff2
Move ATA command definitions to separate file
Woazboat 4df0b73
Allow use of C++ in userspace
Woazboat 6c29c0f
Compile shell as C++
Woazboat 344d475
Format shell.cpp
Woazboat 1224d7f
Remove preempt protect kprintfd output
Woazboat 574aff7
Use subrange for BootstrapRangeAllocator::freePages range view instea…
Woazboat 8b5628b
Change PageManager instance to static local + return reference
Woazboat 75dd476
Use one generic interrupt entry function
Woazboat 548d17c
Unify interrupt handling on x86_64
Woazboat 60846d0
Keep debug info available for debugger outside of QEMU
Woazboat 67a67ab
Fix nullptr dereference in IrqDomain iterators when intitialized with…
Woazboat eae0e5b
x86_32 compatibility
Woazboat 3207271
Clean up MSR code
Woazboat f33f580
Add timer tick debug output
Woazboat 9ed2e0a
Change return value type of Scheduler::getCpuTimerTicks() to size_t
Woazboat c3ec73c
Clean up TextConsole::consoleSetCharacter
Woazboat 80aad9d
Make KMM functions const nodiscard + minor clean up of fillSegment
Woazboat 742f1b6
Define __UINT64_C if not already defined for clangd compatibility
Woazboat 1d8fbca
Make CpuFeatures::cpuHasFeature const nodiscard
Woazboat 0dccc69
Disable x86_64 poison double float
Woazboat 74b9e39
SerialPort use of FIFO in interrupt is broken
Woazboat c5df2cf
Reformat ATADriver
Woazboat 79e5e12
Some more files to .gitignore
Woazboat 57c1919
Separate RangeAllocator template from BootstrapRangeAllocator with fi…
Woazboat e39e52b
Create kernel virtual memory allocator for mapping of MMIO pages
Woazboat 4138fda
Add IDE isDataReady function + debug print changes
Woazboat 55ac0e8
Allow software disabling of detected cpuid features
Woazboat 79cfa08
Remove static IDT pointer object, just create a new one from IDT
Woazboat 7df34a8
Always start qemu with gdbserver in x86_32
Woazboat a1514a0
x86_32_pae compatibility
Woazboat 4dc48aa
Fix rpi3 userspace compiler flags
Woazboat d7fca44
Add user console debug print when userspace partition could not be mo…
Woazboat da3a185
Remove unnecessary line break from debug print
Woazboat ce94f80
Change IrqDomain internal storage container to vector to allow more c…
Woazboat 9747ab4
Ensure correct drive is selected when reading/writing ATA devices
Woazboat 2cb32a9
Move MasterBootRecord + generic partition detection to common code
Woazboat 7f28fa2
Move platform specific driver initialization to architecture dependen…
Woazboat 068f5e3
Architecture specific block device drivers + use generic partition de…
Woazboat 3b09d0c
aarch64: add irq domains for compatibility
Woazboat 145b6c7
aarch64: compound bit op + assignment on volatiles is deprecated
Woazboat d2b31df
aarch64: use unique ptr for thread registers for compatibility
Woazboat afb4d3f
aarch64: Instance variables returned by reference
Woazboat cb92af4
Fix aarch64 compiler flags + compile with c++20
Woazboat 673b8ea
Add aarch64 kernel virtual mem allocator
Woazboat 7274e04
Remove IDE driver from aarch64 and use specific MMC driver instead
Woazboat 08cf108
Stop compilation with error when compiler not found for arm_rpi2
Woazboat ecce728
Stop compilation with error when compiler not found for arm_icp
Woazboat 2575f07
Remove interrupt debug output from MBR partition detection
Woazboat 94a6989
minor cleanup
Woazboat efc00b5
Always start armv8_rpi3 with gdbserver
Woazboat 11a2385
armv7 compatibility
Woazboat a700a9b
Fix deadlock on armv7 when using static objects
Woazboat b2c43c2
Add comment about aarch64 bare metal toolchain source
Woazboat b906309
Adapt ARM integratorcp MMCDriver
Woazboat c83ae67
Fix x86_32 compatibility
Woazboat 8ce3015
Move IDEDriver to x86 architecture specific code
Woazboat 3c98dd2
Change debug category for MBR partition detection
Woazboat d459bab
Move more initialization into init thread
Woazboat ee3c98d
Alloc InitThread on heap to allow it to be deleted
Woazboat c0df7ba
Call global constructors on startup
Woazboat 3865209
Clean up old interrupt handling code + special casing and use new int…
Woazboat b82a43b
Define constants for interrupt vectors
Woazboat 8256d12
Move application processor start code from APIC to ArchMulticore
Woazboat 3786d05
Use new interrupt framework for SMP startup delays
Woazboat 1a22ad6
Fix IoApic indentation + consistent use of irq/global system interrupt
Woazboat ff3b77b
Fix race condition in ATADriver
Woazboat 0f2a2ef
Merge branch 'main' into multicore
Woazboat d1be536
Merge branch 'main' into multicore
Woazboat 0d7a53a
Adjust debug flags
Woazboat 44f61ea
Move interrupt mapping debug print to InitThread after block device i…
Woazboat 7f17215
Use atomic flag for BDManager::probeIRQ
Woazboat 80652da
Categorize & sort includes + fix missing/order dependent includes
Woazboat 62634a3
Add missing include
Woazboat 9a37026
Fix non-architecture independent printf format flags
Woazboat d373715
Change InterruptDescriptorTable to static local singleton
Woazboat fc139cb
Remove unused code
Woazboat ad5a360
Fix cmake arm_rpi2 qemugdb target
Woazboat 2f5c539
Fix arm_rpi2 boot
Woazboat 7ce63a6
Make SMP cpu list lock a static local singleton
Woazboat c36d7a8
Better bounds check + clean up userspace
Woazboat 82b0ba9
Fix TextConsole out of bounds access
Woazboat 88929df
Add functions for text mode framebuffer dimensions
Woazboat 87042b1
Add paging initialized parameter to boottime kprintf functions
Woazboat 90df805
Save multiboot framebuffer info
Woazboat dc336a9
Add PAT MSR defines
Woazboat 18a9e3e
Save bootloader commandline
Woazboat f8b2378
Fix initial kernel memory mapping size on boot
Woazboat 2393e73
Fix block offset in ATADriver write + improved debug output + debug i…
Woazboat 1ff6845
New bitmap constructor for initialization with existing data
Woazboat 75e0905
Fix infinite recursion on kernel panic
Woazboat b146551
Loader ELF init debug output
Woazboat cc4965c
Add partition type list comment to MBR
Woazboat 1877015
Better file system debug output
Woazboat 35fdfb3
Add bitmap byte size function
Woazboat 23b3766
Simplify MinixStorageManager::flush
Woazboat 90da924
Make File/Inode flush() virtual + default forward to inode
Woazboat 0c018e6
Change Initthred debug color to red
Woazboat 810bfe5
Change debug spinner color: user thread = blue, kernel thread = green
Woazboat 1754d42
Return error from UserProcess constructor when initialization failed
Woazboat b6553dc
Ignore empty commands in shell
Woazboat 589569b
Fix debug format flag for 32 bit multiarch compatibility
Woazboat ca7e6eb
Remove EASTL tests
Woazboat 76f5d01
Prevent read/write outside of partition in exe2minixfs
Woazboat 60ac14d
Fix backtrace
Woazboat 227cc48
fix typo
daef 03207d0
Fix UB in add-debug libelfin library when calling front() on an empty…
Woazboat c586289
Fix potential integer overflow in libelfin mmap_loader::load()
Woazboat 614b780
Merge branch 'main' into multicore
Woazboat ad1b59a
Use __is_convertible builtin in ustl when available
Woazboat a901873
Merge branch 'main' into multicore
Woazboat File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure this is correct. indeed volatile is deprecated for many use cases where users commonly had the misconception that volatile would provide some form of thread safety... but here we literally want what volatile is there for: "do not optimize out any operations on this variable".
do i misremember that atomic<> may be optimized out?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That line no longer exists in the current version of the file.
https://github.com/Woazboat/sweb/blob/multicore/arch/x86/common/source/assert.cpp#L98
The reason why it was there in the first place was as a quick interim measure to prevent backtraces and assert messages from individual cpu cores from overlapping and interspersing, but that has shortly afterwards been replaced by proper locking/serialization.
(the version with volatile also no longer compiled with the volatile deprecation changes)