Post deleted
Re: The OS does not link correctly on x86_64
try switching --target x86_64-elf and --arch x86_64-elf to --target=x86_64-elf and -march=x86_64
Skylight: https://github.com/austanss/skylight
I make stupid mistakes and my vision is terrible. Not a good combination.
NOTE: Never respond to my posts with "it's too hard".
I make stupid mistakes and my vision is terrible. Not a good combination.
NOTE: Never respond to my posts with "it's too hard".
Re: The OS does not link correctly on x86_64
Post deleted
Last edited by rpio on Tue Aug 12, 2025 7:15 pm, edited 2 times in total.
Re: The OS does not link correctly on x86_64
I don't believe the -arch switch exists. I believe you were attempting to use -march.ngx wrote:Yes thanks, that also compiles well, but what exactly is the difference between -march and -arch for the linker - because linker said it would ignore -arch, but does not say same thing when I use -march?rizxt wrote:try switching --target x86_64-elf and --arch x86_64-elf to --target=x86_64-elf and -march=x86_64
But I probably figured out the problem with the address printing, I checked if the address is correct and not garbage not by looking at printf output, but instead by using the if comparison and it showed that the variable stores the right address. The problem is then with my printf implementation, I would be very grateful if you helped me to figure out the problem with printf(I think it is somehow related to 64-Bit mode switch because it worked in 32-Bit mode)
My printf implementation is starting on line 149 in https://pastebin.com/5LhRHSUA
Skylight: https://github.com/austanss/skylight
I make stupid mistakes and my vision is terrible. Not a good combination.
NOTE: Never respond to my posts with "it's too hard".
I make stupid mistakes and my vision is terrible. Not a good combination.
NOTE: Never respond to my posts with "it's too hard".
Re: The OS does not link correctly on x86_64
Your printf function probably only supports 64-bit integers.ngx wrote:Yes thanks, that also compiles well, but what exactly is the difference between -march and -arch for the linker - because linker said it would ignore -arch, but does not say same thing when I use -march?rizxt wrote:try switching --target x86_64-elf and --arch x86_64-elf to --target=x86_64-elf and -march=x86_64
But I probably figured out the problem with the address printing, I checked if the address is correct and not garbage not by looking at printf output, but instead by using the if comparison and it showed that the variable stores the right address. The problem is then with my printf implementation, I would be very grateful if you helped me to figure out the problem with printf(I think it is somehow related to 64-Bit mode switch because it worked in 32-Bit mode)
My printf implementation is starting on line 149 in https://pastebin.com/5LhRHSUA
I have printf errors too!
Skylight: https://github.com/austanss/skylight
I make stupid mistakes and my vision is terrible. Not a good combination.
NOTE: Never respond to my posts with "it's too hard".
I make stupid mistakes and my vision is terrible. Not a good combination.
NOTE: Never respond to my posts with "it's too hard".
Re: The OS does not link correctly on x86_64
Post deleted
Last edited by rpio on Tue Aug 12, 2025 7:15 pm, edited 2 times in total.
Re: The OS does not link correctly on x86_64
Post deleted
Last edited by rpio on Tue Aug 12, 2025 7:15 pm, edited 2 times in total.
-
Octocontrabass
- Member

- Posts: 6277
- Joined: Mon Mar 25, 2013 7:01 pm
Re: The OS does not link correctly on x86_64
You need to use the stdarg.h macros to read the arguments to your printf function.

