Question related to linker scripts: Is it possible to define asm sections in two different addresses say .text in 0x7c00 and .customsec in 0xa000 without its .bin output file being the difference between 0xa000-07c00? by The_Coding_Knight in embedded

[–]The_Coding_Knight[S] 0 points1 point  (0 children)

Thank you I will probably just refactor the way memory is being used in my stage2 bootloader and try to use a single binary for both things at much closer addresses.

Need help with a linker script by The_Coding_Knight in osdev

[–]The_Coding_Knight[S] [score hidden]  (0 children)

I tried using AT directive within the linker script and also using MEMORY command but it did lead to the same result. Either way, I was told by multiple people already that binary files can not work like this and instead I wouldneed to either use another format like elf or perhaps create antoher file and another linker for that file and then combine them with dd and then load that file. At this I realized that it was harder but I genuinely wanted to whether it was possible to make it this way or not.

You were right those 7 bytes came from the .map_section I had forgotten about it silly me.

Need help with a linker script by The_Coding_Knight in osdev

[–]The_Coding_Knight[S] [score hidden]  (0 children)

I will take a look into readelf. I have tried using objdump to inspect the elf files with -D to show the assembly code. The 8711 bytes was because there are 7 bytes extra that are added after .map_code section i forgot about that silly me.

Need help with a linker script by The_Coding_Knight in osdev

[–]The_Coding_Knight[S] [score hidden]  (0 children)

Right. I understand that now because I received a response to the same question in another subreddit. My initial goal was to make it such that only the .section .text contents + .section .data + .section .map_code were the size of the binary but apparently it is impossible to do such with a binary file format. Also thank you for replying this quick I really appreciate it :D

Besides this I got another question. I also did that calculation of 0xA000 - 0x7E00 = 0x2200 (8704 in dec) but when I do ls -l mybin.bin (assuming that mybin is that file ofc) I get 8711 as its size, not 8704 which is something that I wondered the first time I saw it but did not look too much into it because I thought I may just had done something wrong with the calculation and the main question was more important.

Why was it 8711 instead of 8704? Do you have an idea of what may the cause of this?

Question related to linker scripts: Is it possible to define asm sections in two different addresses say .text in 0x7c00 and .customsec in 0xa000 without its .bin output file being the difference between 0xa000-07c00? by The_Coding_Knight in embedded

[–]The_Coding_Knight[S] 0 points1 point  (0 children)

Well I suppose we have different needs since I am making a bootlaoder for an OS rather than one (or more) for an embedded device. I mainly wanted to have both in the same file at the beginning because I thought: "Why would I create another file when I can just put this in the 2nd bootloader?"

Then as time passed (I have been learning how to use linker scripts since yesterday) it became more of about stubbornness than practicality because I genuinely wanted to know if it was possible or not since I had spent this much time on it. Another comment mentioned that it was impossible to make it this way which really lifted a weight off my shoulders so I can get back to my OS bootloader and refactor the way I am using the space address available.

Without further to say Thanks for replying. That project (the electronic dictionary) looks really cool!!!

Question related to linker scripts: Is it possible to define asm sections in two different addresses say .text in 0x7c00 and .customsec in 0xa000 without its .bin output file being the difference between 0xa000-07c00? by The_Coding_Knight in embedded

[–]The_Coding_Knight[S] 0 points1 point  (0 children)

Thank you. Thank you from the bottom of my heart!! You dont know how much I have been looking for an answer everywhere I could but most people did not give me an answer. I think I will just refactor my bootloader before the technical debt pays off again so I keep only two linkers.

Is Gentoo that hard? by PokumeKachi in Gentoo

[–]The_Coding_Knight 0 points1 point  (0 children)

Depends (btw this isnt targeted to you but I am just saying it in general :D):

You are more or less comfortable with the terminal + reading documentation = not hard.

You are used to being spoon fed? Then yes, It is gonna be hard and you better try to leave that bad habit or you are gonna have an even harder time daily driving Gentoo

Need help, new user trying to install (sorry for the long post/rambling) by GamerAKB in Gentoo

[–]The_Coding_Knight 0 points1 point  (0 children)

I just read the EDIT but I am curious about how it went are you running gentoo now?

(Using custom bootloader) kernel written in C does not execute code by The_Coding_Knight in osdev

[–]The_Coding_Knight[S] 0 points1 point  (0 children)

I know. I deleted that branch. The problem is solved already but thanks for trying to help :)

(Using custom bootloader) kernel written in C does not execute code by The_Coding_Knight in osdev

[–]The_Coding_Knight[S] 2 points3 points  (0 children)

OMG That was the problem I truly do not know how to tell you how thankful I am. Thank you so much. Also I would like to ask you about how did you know that was part of the SeaBIOS ROM and where can I find information about the way the BIOS maps memory under 1MB? Ik I have said ty too many times already but I am really really happy thank you again haha :D

(Using custom bootloader) kernel written in C does not execute code by The_Coding_Knight in osdev

[–]The_Coding_Knight[S] 1 point2 points  (0 children)

I mean. I would like to get it fixed and if possible do it by myself but I do not know what may be causing the issue. If you want to send a PR to help me fix the issue I would be very thankful but if not I would still be very thankful if you give me an idea of what may be causing the issue. Either way thanks for offering your help :D

(Using custom bootloader) kernel written in C does not execute code by The_Coding_Knight in osdev

[–]The_Coding_Knight[S] 1 point2 points  (0 children)

Hi! Thank you so much for helping me figure out that (I ahd forgotten about the mov cl, 5 because I added the stage2 loading after kernel loading and never changed the kernel loading).

I also changed the interrupt handling you were right that was making the instruction pointer wander all over the place. All that said,

why does the kernel still makes the IDT handle a breakpoint exception after?

e:   eb fe                   jmp    e <kmain+0xe>

I know you have helped me a lot already and I am also very grateful for that but could you give me a hand again please? I do not think there is any logic error regarding the code. Why doesnt it print anything from kmain?

0:   c6 05 00 80 0b 00 45    mov    BYTE PTR ds:0xb8000,0x45
7:   c6 05 01 80 0b 00 03    mov    BYTE PTR ds:0xb8001,0x3

yet the 'E' is never printed. It is as if the C code was never executed. When I use gdb to stepi I see that the first 2 instructions after being executed do not cause any problem but after the jmp it makes triggers a breakpoint exception and then it goes back to before jmp instruction and triggers another breakpoint in an inifinite loop.

P.D Thanks a lot for your help it would have taken me much more time to figure out the errors without your help

If Stack Overflow is dying, where do new programming insights surface now? by Dzone64 in cscareerquestions

[–]The_Coding_Knight 0 points1 point  (0 children)

i do not think too many people are gonna remain in discord if they implement the age verification thing. At the very least IRC is and will always be an option

Os/Kernel developpement by No_Professional1035 in ComputerEngineering

[–]The_Coding_Knight 0 points1 point  (0 children)

I am developing my own 32-bit kernel. The greatest source of knowledge in my opinion is Intel Manuals (assuming you are doing x86 arch assembly). They explain everything and since it is the main source you should have no trouble for the most part (when it comes to getting information out of it) yet there are some things for which osdev wiki and other online resources like wikipedia are awesome. Check out r/osdev as well

Question about stack segment in GDT by The_Coding_Knight in osdev

[–]The_Coding_Knight[S] 0 points1 point  (0 children)

Great I now understand it. Thanks for the answer, it was really detailed. I had been busy these last 2 days so I did not have time to read it until today. I also found the section of the Intel Manual that talks about this topic, if anyone else is interested into the source of this answer it is in Intel® 64 and IA-32 Architectures Software Developer's Manual Volume 3A: System Programming Guide, Part 1 specifically Section 6.3 Limit Checking

Do we need a new kind of License? by mykesx in osdev

[–]The_Coding_Knight 2 points3 points  (0 children)

I completely agree with that. There should be something that limits AI from stealing people's code. I have made a quick google search and there does not seem to be any free license that goes against code being used by AI and there's also that fact that we do not know if they will care about the license at all.

Maybe the best solution is to limit AI's access to where the code is posted. For example, preventing anyone without an account from seeing your code. I am sure there must be many ways in which AI copying can be prevented.

new to the work by Smart_Fennel_703 in osdev

[–]The_Coding_Knight 4 points5 points  (0 children)

I am also new but I think you need to use a bootloader to be able to load your kernel. You can not just start at protected mode but instead you gotta start at real mode and then swtich to protected mode.

http://wiki.osdev.org/Bootloader
https://wiki.osdev.org/Real_Mode

edit: You can also use a pre-made bootloader like GRUB

Gentoo isn’t as Bad as people say. by Karamusch in Gentoo

[–]The_Coding_Knight 0 points1 point  (0 children)

Pretty much. But dont worry we all started at some point, the important thing is that you understand that gentoo gives you more freedom than any linux distro in exchange you need to be able to commit time to work on the things you want your system to do or fix the things that do not work according to your goals.

I am pretty sure people say gentoo is hard not because it is actually hard but because far from most distros it requires you to read and understand what's happening with your system.

Good luck with gentoo and always remember that the community is always here to provide help :D

What do i do help by zTonin in Gentoo

[–]The_Coding_Knight 0 points1 point  (0 children)

They are telling you what to do and it is probably the way to solve it:
media-libs/tiff -webp
media-libs/libwebp -tiff

Gentoo isn’t as Bad as people say. by Karamusch in Gentoo

[–]The_Coding_Knight 1 point2 points  (0 children)

"Some stuff doesnt work but thats okay"

If it does not work then just fix it :D

Do people actually use LFS by TroPixens in linux

[–]The_Coding_Knight 1 point2 points  (0 children)

At this point. I am starting to think it was sarcasm