![]() To quickly scope the problem with the memory allocator I figured there are So I didn’t really give much thought to the difference inīehavior between format! and alloc::vec::Vec and went after the memory What’s going once you hit them, and hard to debug to figure out where the ![]() When I use alloc::vec::Vec, but memory related bugs are often claimed toīe a sort of a mistery: hard to test to prevent them, hard to understand It’s weird that the problem only manifested when I use format!, but not Interesting… It’s time to debug… Hypothesis 1: bad memory allocator Problem somehow manifests only when I use format!, but usingĪlloc::vec::Vec doesn’t result in any problems I could see. It works, things broke and QEMU reported that the emulated system caught anĪdding and removing alloc::vec::Vec and format! confirmed that the When I loaded a newly built binary with some format! invocations to see how I though that it might be quite useful for logging purporses format! macro is a printf-likeish Rust macro to for string However out of curiousity I went to look at what’s else available in theĪlloc that might come in handy. Ready to celebrate the vicotry and write another post on dynamic memory Little bit with Rust alloc::vec::Vec and it worked just fine. Rust I found out that things don’t quite work reliably and that’s whereĪfter plugging in the dynamic memory allocator to the Rust code I played a So I implemented a simplistic memory allocator, specficailly to be used onlyĭuring early stages of the setup process. Provide a convenient interface from that library I might need a dynamic While working on the DeviceTree parsing I came to the conclusion that to Kernel code, it’s quite useful piece of information. So basically unless you want to hardcode the hardware configuration in the what devices are connected to the system (timers, serial ports, host.how many compute units it has (CPU or other kinds).The OS kernel and the OS kernel can use it to understand what kind of hardware Firmware is expected to pass the DeviceTree to DeviceTree describes the system hardware andĬonfiguration to some extent. Related to this post, but nevertheless all the sources are available onĪfter setting up basic Rust infrstructure for the project I wanted to start In this post I will cover the background that lead to the problem, In the previous post I added Rust to the project and since then I wasĮxperimenting with parsing DeviceTree, however while doing that I stumbled 26 December 2020 Debugging AArch64 using QEMU and GDB
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |