-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat: add APIs to draw text to a framebuffer #48
Draft
kkebo
wants to merge
1
commit into
main
Choose a base branch
from
issues/41
base: main
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.
+275
−0
Conversation
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
kkebo
changed the title
WIP: feat: add APIs to draw text to a framebuffer
feat: add APIs to draw text to a framebuffer
Nov 29, 2024
$ make clean all
rm -f kernel.elf kernel8.img kernel.map
swift package clean
swift build --triple aarch64-none-none-elf -c release -Xswiftc -Osize --experimental-lto-mode=full -Xswiftc -experimental-hermetic-seal-at-link
Building for production...
error: compile command failed due to signal 6 (use -v to see invocation)
swift-frontend: /home/build-user/swift/lib/SIL/Utils/OwnershipLiveness.cpp:84: swift::LinearLiveness::LinearLiveness(swift::SILValue, swift::LinearLiveness::IncludeExtensions_t): Assertion `borrowedValue && borrowedValue.isLocalScope()' failed.
Please submit a bug report (https://swift.org/contributing/#reporting-bugs) and include the crash backtrace.
Stack dump:
0. Program arguments: /home/kebo/.local/share/swiftly/toolchains/main-snapshot-2024-11-28/usr/bin/swift-frontend -frontend -emit-bc /home/kebo/swift_os/Sources/Kernel/Framebuffer.swift /home/kebo/swift_os/Sources/Kernel/kmain.swift /home/kebo/swift_os/Sources/Kernel/mbox.swift /home/kebo/swift_os/Sources/Kernel/mmio.swift /home/kebo/swift_os/Sources/Kernel/putchar.swift /home/kebo/swift_os/Sources/Kernel/uart.swift -supplementary-output-file-map /tmp/TemporaryDirectory.Ujoqzj/supplementaryOutputs-1 -target aarch64-none-none-elf -Xllvm -aarch64-use-tbi -disable-objc-interop -I /home/kebo/swift_os/.build/aarch64-none-none-elf/release/Modules -color-diagnostics -g -debug-info-format=dwarf -dwarf-version=4 -module-cache-path /home/kebo/swift_os/.build/aarch64-none-none-elf/release/ModuleCache -swift-version 6 -Osize -lto=llvm-full -D SWIFT_PACKAGE -D RASPI4 -no-allocations -function-sections -disable-stack-protector -enable-experimental-feature Embedded -enable-experimental-feature Volatile -enable-llvm-vfe -enable-llvm-wme -conditional-runtime-records -internalize-at-link -empty-abi-descriptor -resource-dir /home/kebo/.local/share/swiftly/toolchains/main-snapshot-2024-11-28/usr/lib/swift -file-compilation-dir /home/kebo/swift_os -Xcc -fmodule-map-file=/home/kebo/swift_os/.build/aarch64-none-none-elf/release/MailboxMessage.build/module.modulemap -Xcc -I -Xcc /home/kebo/swift_os/Sources/MailboxMessage/include -Xcc -fmodule-map-file=/home/kebo/swift_os/.build/aarch64-none-none-elf/release/Font.build/module.modulemap -Xcc -I -Xcc /home/kebo/swift_os/Sources/Font/include -Xcc -fmodule-map-file=/home/kebo/swift_os/.build/aarch64-none-none-elf/release/Support.build/module.modulemap -Xcc -I -Xcc /home/kebo/swift_os/Sources/Support/include -Xcc -g -module-name Kernel -package-name swift_os -in-process-plugin-server-path /home/kebo/.local/share/swiftly/toolchains/main-snapshot-2024-11-28/usr/lib/swift/host/libSwiftInProcPluginServer.so -plugin-path /home/kebo/.local/share/swiftly/toolchains/main-snapshot-2024-11-28/usr/lib/swift/host/plugins -plugin-path /home/kebo/.local/share/swiftly/toolchains/main-snapshot-2024-11-28/usr/local/lib/swift/host/plugins -enable-default-cmo -parse-as-library -num-threads 4 -o /home/kebo/swift_os/.build/aarch64-none-none-elf/release/Kernel.build/Framebuffer.swift.bc -o /home/kebo/swift_os/.build/aarch64-none-none-elf/release/Kernel.build/kmain.swift.bc -o /home/kebo/swift_os/.build/aarch64-none-none-elf/release/Kernel.build/mbox.swift.bc -o /home/kebo/swift_os/.build/aarch64-none-none-elf/release/Kernel.build/mmio.swift.bc -o /home/kebo/swift_os/.build/aarch64-none-none-elf/release/Kernel.build/putchar.swift.bc -o /home/kebo/swift_os/.build/aarch64-none-none-elf/release/Kernel.build/uart.swift.bc
1. Swift version 6.1-dev (LLVM 42f3e8ef873e24d, Swift c690fefef71c26a)
2. Compiling with the current language version
3. While verifying SIL function "@$s6Kernel11FramebufferV10drawString_1x1y5colorys06StaticD0V_S2is6UInt32VtF".
for 'drawString(_:x:y:color:)' (at /home/kebo/swift_os/Sources/Kernel/Framebuffer.swift:128:5)
#0 0x00005555bf6ab6e0 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/home/kebo/.local/share/swiftly/toolchains/main-snapshot-2024-11-28/usr/bin/swift-frontend+0x7dbb6e0)
#1 0x00005555bf6a951c llvm::sys::RunSignalHandlers() (/home/kebo/.local/share/swiftly/toolchains/main-snapshot-2024-11-28/usr/bin/swift-frontend+0x7db951c)
#2 0x00005555bf6abdfc SignalHandler(int) Signals.cpp:0:0
#3 0x00007ffefc4ac7b0 (linux-vdso.so.1+0x7b0)
#4 0x00007ffefa900a50 __pthread_kill_implementation ./nptl/./nptl/pthread_kill.c:44:76
#5 0x00007ffefa8ba72c raise ./signal/../sysdeps/posix/raise.c:27:6
#6 0x00007ffefa8a747c abort ./stdlib/./stdlib/abort.c:81:7
#7 0x00007ffefa8b41a4 __assert_fail_base ./assert/./assert/assert.c:89:7
#8 0x00007ffefa8b420c (/lib/aarch64-linux-gnu/libc.so.6+0x3420c)
#9 0x00005555b9998660 swift::LinearLiveness::LinearLiveness(swift::SILValue, swift::LinearLiveness::IncludeExtensions_t) (/home/kebo/.local/share/swiftly/toolchains/main-snapshot-2024-11-28/usr/bin/swift-frontend+0x20a8660)
#10 0x00005555b99de714 swift::SILVisitorBase<(anonymous namespace)::SILVerifier, void>::visitSILBasicBlock(swift::SILBasicBlock*) SILVerifier.cpp:0:0
#11 0x00005555b99d5110 (anonymous namespace)::SILVerifier::visitSILBasicBlock(swift::SILBasicBlock*) SILVerifier.cpp:0:0
#12 0x00005555b99d3514 (anonymous namespace)::SILVerifier::visitSILFunction(swift::SILFunction*) SILVerifier.cpp:0:0
#13 0x00005555b99ccc58 swift::SILFunction::verify(swift::CalleeCache*, bool, bool, bool) const (/home/kebo/.local/share/swiftly/toolchains/main-snapshot-2024-11-28/usr/bin/swift-frontend+0x20dcc58)
#14 0x00005555b99cfef8 swift::SILModule::verify(swift::CalleeCache*, bool, bool) const (/home/kebo/.local/share/swiftly/toolchains/main-snapshot-2024-11-28/usr/bin/swift-frontend+0x20dfef8)
#15 0x00005555b99cfdfc swift::SILModule::verify(bool, bool) const (/home/kebo/.local/share/swiftly/toolchains/main-snapshot-2024-11-28/usr/bin/swift-frontend+0x20dfdfc)
#16 0x00005555b8a9b98c swift::CompilerInstance::performSILProcessing(swift::SILModule*) (/home/kebo/.local/share/swiftly/toolchains/main-snapshot-2024-11-28/usr/bin/swift-frontend+0x11ab98c)
#17 0x00005555b8786670 performCompileStepsPostSILGen(swift::CompilerInstance&, std::unique_ptr<swift::SILModule, std::default_delete<swift::SILModule> >, llvm::PointerUnion<swift::ModuleDecl*, swift::SourceFile*>, swift::PrimarySpecificPaths const&, int&, swift::FrontendObserver*) FrontendTool.cpp:0:0
#18 0x00005555b87859b0 swift::performCompileStepsPostSema(swift::CompilerInstance&, int&, swift::FrontendObserver*) (/home/kebo/.local/share/swiftly/toolchains/main-snapshot-2024-11-28/usr/bin/swift-frontend+0xe959b0)
#19 0x00005555b87935b8 withSemanticAnalysis(swift::CompilerInstance&, swift::FrontendObserver*, llvm::function_ref<bool (swift::CompilerInstance&)>, bool) FrontendTool.cpp:0:0
#20 0x00005555b8788198 performCompile(swift::CompilerInstance&, int&, swift::FrontendObserver*) FrontendTool.cpp:0:0
#21 0x00005555b87873a0 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) (/home/kebo/.local/share/swiftly/toolchains/main-snapshot-2024-11-28/usr/bin/swift-frontend+0xe973a0)
#22 0x00005555b858cc70 swift::mainEntry(int, char const**) (/home/kebo/.local/share/swiftly/toolchains/main-snapshot-2024-11-28/usr/bin/swift-frontend+0xc9cc70)
#23 0x00007ffefa8a7740 __libc_start_call_main ./csu/../sysdeps/nptl/libc_start_call_main.h:74:3
#24 0x00007ffefa8a7818 call_init ./csu/../csu/libc-start.c:128:20
#25 0x00007ffefa8a7818 __libc_start_main ./csu/../csu/libc-start.c:347:5
#26 0x00005555b858be70 _start (/home/kebo/.local/share/swiftly/toolchains/main-snapshot-2024-11-28/usr/bin/swift-frontend+0xc9be70)
make: *** [Makefile:25: swift] Error 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
resolves #41