Skip to main content
Filter by
Sorted by
Tagged with
17 votes
3 answers
1k views

I'm reading a GNU as introductory book for programs running on top of an OS. I'm at the stack memory part and I was curious how the stack looks like in a freestanding environment. I'm guessing that ...
mltm's user avatar
  • 605
0 votes
1 answer
114 views

In freestanding environment without standard library I use: template <typename Func> auto for_each_until_false(Func func) const -> void { for (size_t i = 0; i < len; ++i) { if ...
user529327's user avatar
0 votes
0 answers
82 views

I created a unwrap freestanding macro that unwraps optional values. The implementation looks like the following code: { [\(raw: argumentName)] in guard let \(raw: argumentName) else { ...
naljin's user avatar
  • 645
3 votes
1 answer
302 views

I am developing a program for embedded system that will not use dynamic memory allocation. How can I prevent the GCC from producing deleting destructor (the destructor with D0 in its mangled name)? It ...
jiwopene's user avatar
  • 3,767
0 votes
1 answer
2k views

Edit: Is this related to this bug report? Unable to find uint8_t despite having build the freestanding libs for C++ The error I get is: FAILED: CMakeFiles/nak.dir/Kernel/src/kernel.cpp.o /home/jared/...
Happy Jerry's user avatar
0 votes
1 answer
1k views

C++ has many aspects, included by default, that are not desirable or even functional on embedded bare metal / free standing platforms. How can I configure g++ to compile C++ in a manner suitable for ...
SRobertJames's user avatar
  • 9,367
1 vote
1 answer
347 views

In C, how can I detect if a some form of malloc has been made available, regardless of target platform or compiler? Is it enough to detect _STDLIB_H_? I would like to include a header utility ...
codechimp's user avatar
  • 1,565
4 votes
2 answers
4k views

While developping a bare metal firmware in C for a RV32IM target (RISC-V), I encountered a linking error when LTO is enabled: /home/duranda/riscv/lib/gcc/riscv64-unknown-elf/10.2.0/../../../../riscv64-...
DurandA's user avatar
  • 1,708
1 vote
1 answer
144 views

I'm developing a basic C kernel in a Kali machine and testing it inside QEMU. This is the kernel code: void kernel_main(); void print(); void print() { char* vidMem = (char*)0xb8000; *vidMem =...
0xPictor's user avatar
4 votes
1 answer
132 views

I'm writing a FAT16 driver in GNU C for a hobby operating system, and I have a structure defined as such: struct directory_entry { uint8_t name[11]; uint8_t attrib; uint8_t name_case; uint8_t ...
Benji Dial's user avatar
0 votes
1 answer
234 views

I've started writing my very own kernel and am developing on Windows 10. I am using the following tools: gcc 8.1.0 elf x86_64 for compiling my C code, and for linking. I am using this Windows package....
David Callanan's user avatar
2 votes
0 answers
335 views

Generally, I've already read the following articles, checked the "freestanding/hosted" definition in gcc language standard, but not got my doubts resolved yet. https://gcc.gnu.org/onlinedocs/gcc/...
Shadow's user avatar
  • 21
0 votes
1 answer
495 views

I am trying to write my own operating system. I have followed the tutorials on the OSDev Wiki, and I am now working on writing a console mode, with commands. I need to be able to split a char* into a ...
oculometric's user avatar
2 votes
1 answer
816 views

when I try to compile C code that includes another C header I get this error: x86_64-uefi/../../libk/string.h:9:10: error: function declared 'ms_abi' here was previously declared without ...
Rottenheimer2's user avatar
9 votes
1 answer
2k views

What are the features that I can use in c++ freestanding environment? I am developing a little kernel (for my own pleasure) and I know that I can't use the whole stdlib library, but what else ? when I ...
Adrien's user avatar
  • 459
-1 votes
2 answers
278 views

so I am trying to convert some integers in to character arrays that my terminal can write. so I can see the value of my codes calculations for debugging purposes when its running. as in if the int_t ...
skyline's user avatar
  • 55
4 votes
1 answer
191 views

I'm working on a kernel. One of the tasks in writing a kernel is that a C library must be ported. Some functions such as memcmp, strlen and so on have to be rewritten. Most of the time I see the code ...
user142809's user avatar
26 votes
4 answers
12k views

The question I have is mostly related to section four, paragraph six. The two forms of conforming implementation are hosted and freestanding. A conforming hosted implementation shall accept any ...
autistic's user avatar
  • 15.8k
3 votes
2 answers
9k views

Just a simple question: Let's say I had the following two assembly programs: 1: add10: add eax, 10 ret ;call add5 from other file 2: add5: add eax, 5 ret ;call add10 from other file ...
Easton's user avatar
  • 73
64 votes
1 answer
51k views

What is ffreestanding in gcc ? What is it used for ? I came across the following : gcc -ffreestanding -m32 -c kernel.c -o kernel.o and do not understand, what does it mean exactly.
saplingPro's user avatar
  • 21.5k
4 votes
1 answer
510 views

How would compilers implementing the freestanding portion of each different standard below have to differ? What would be the fewest number of modes (specified by command line flags, for example) ...
Shea Levy's user avatar
  • 5,505
25 votes
2 answers
7k views

The code I'm working on is supposed to be possible to build for both hosted and freestanding environments, providing private implementations for some stdlib functions for the latter case. Can I ...
Christoffer's user avatar