Skip to content
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
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Conversation

kkebo
Copy link
Owner

@kkebo kkebo commented Nov 25, 2024

resolves #41

@kkebo kkebo self-assigned this Nov 25, 2024
@kkebo 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
@kkebo
Copy link
Owner Author

kkebo commented Nov 30, 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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement an API to draw characters
1 participant