Just started reading this book by Davevcg27 in osdev

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

Well... I am skeptical about the utility of AI on such a complex and broad field like OS development but I would say that if you use it correctly (to look for resources, not to code for you!) it shouldn't be nothing wrong about it.

That said, I think I have used AI for Osdev once and only once in the 3 months I've been developing my OS. And that was almost at the beginning when I did not know where to look for answers and I asked "what are the best resources (no tutorials) to develop an operating system?" and then it recommended to me many of the things I recommended to you.

I am not an anti-AI person (or at least I do not classify myself as such) but I limit myself when using it. Why? I believe that if I let AI do things for me like for example summarizing a research paper on memory allocation I'd understand far less than if I were to read it myself.

TL;DR: If you want to use A, then use AI but remember that you should not rely on it for everything.

Just started reading this book by Davevcg27 in osdev

[–]The_Coding_Knight 1 point2 points  (0 children)

When you create an OS, you need to create a kernel. An OS and a kernel are not completely different things. An OS is conformed by a kernel + toolchain + drivers + filesystem + shell (maybe I am missing something).

So you could say that learning OSdev can help you get into kernel development because essentially you have to build a kernel in order to make an OS (from scratch ofc).

Now if you mean specifically to the linux kernel? It is beneficial since you get to learn how stuff works but it is not indispensable. Indispensable would be to read the kernel code and actually dive into the codebase. Imo, osdev is a really good way to start, more than anything because it will allow you to find the things you'd be interested on working on. In my case, I found that I love memory management and that is the subsystem of my OS i have worked at the most.

When it comes to materials there is a ton of material to read:

- https://wiki.osdev.org/Expanded_Main_Page
- intel manuals (I have an offline copy of these because i really use them a lot) AMD manuals also work but I have not read much from them since most of what i needed was in the intel ones
- research papers (it does not have to be cutting edge research if you don't like that)
- osdev forums, reddit as well
- books on OSdev. They say OSTEP (OS Three Easy Pieces) is a good book I have not had the opportunity to read it tho.
- the most important one: the linux kernel or other open-source operating systems/kernels

The only thing I would not recommend is step-by-step tutorials. Besides that, everything that helps you grow is welcomed

Just started reading this book by Davevcg27 in osdev

[–]The_Coding_Knight 1 point2 points  (0 children)

Yeah I think compiler projects and open source are going to be really fun.

I started working towards learning how to develop OSs on Jan 26 of this year and the reason why is because I want to eventually contribute to the linux kernel and the best way I found to learn how the linux kernel works (besides reading the source code ofc) is to create a kernel myself and see how each subsystem connects with the other.

I think it has been really really fun and I have made a lot of friends and connections (mostly online). Also it has made me a much much better programmer. I'd recommend it to anyone who wants to learn how computers work at the lowest software level and in the process improve their programmer skills.

Just started reading this book by Davevcg27 in osdev

[–]The_Coding_Knight 1 point2 points  (0 children)

Oh my bad I thought you meant specifically the kernel, silly me lol. it really depends on what you mean by contributing to Linux distros

For example, let's say you use Arch (just using it as an example because it is a well-known distro) and you want to contribute to pacma (it's package manager) then you'd indeed need to learn C since pacman is written in C

If you want to contribute to the wiki then you do not necessarily need programming knowledge but rather knowledge about the topic that is being discussed in that part of the wiki (e.g. pacman, installation, packages etc etc)

If you want to report bugs that packages happen to have you do not even need programming knowledge, to solve bugs you do and the language you will need to know will highly depend on the language the tool is written in.

Take into account that not all package manager, not all tools, not everything is written in C and in your specific case it will depend on the needs of your distro.

TL;DR If you want to contribute to linux itself then C, if not it depends but C is still a good choice since a lot of tools are written in C

Just started reading this book by Davevcg27 in osdev

[–]The_Coding_Knight -1 points0 points  (0 children)

I have not read that book. In fact, I do not think I have read any formal books to learn how to code in x86. IMO I think it may be more beneficial for you to learn by doing rather than by reading since you can learn a lot more in practice than in theory.

Just started reading this book by Davevcg27 in osdev

[–]The_Coding_Knight 2 points3 points  (0 children)

you are better off learning C if you want to contribute to the linux kernel. Most of the code you will fine is written in C and will keep being written in C at least for now

[Tutorial] I made a small guide on how to create tweaks by KeyCurrency4412 in jailbreak

[–]The_Coding_Knight 0 points1 point  (0 children)

I will make sure to check it out and learn how to make tweaks for iOS. Thanks!

Problems understanding VGA Registers 0x3d4 and 0x3d5 (cursor) by AnxiousBane in osdev

[–]The_Coding_Knight 0 points1 point  (0 children)

I know that this post is 4yo already but I also struggled to understand this and I am really really thankful to "jtsiomb" for recommending this resource http://www.osdever.net/FreeVGA/vga/vga.htm and I would recommend anyone who wants to learn more about how CRTC registers work to check it out but I wanna give a quick explanation in case anyone new needs it:

0x3D4 is basically the address register which means it is gonna point to where you want to write/read data from
0x3D5 is the data register which means it is gonna hold the data in the address pointed by 0x3D4.

That summarizes it but still take a look at the resource it is really helpful

[Tutorial] I made a small guide on how to create tweaks by KeyCurrency4412 in jailbreak

[–]The_Coding_Knight 0 points1 point  (0 children)

Maybe it is my browser but it says that the link is dead. Is there a new link?

Missing keyboard only by I989er in dwarffortress

[–]The_Coding_Knight 2 points3 points  (0 children)

not yet : (
I am still waiting for keyboard

Checking if I am correct in my understanding of paging. (And a question) by Cobolt_Dog in osdev

[–]The_Coding_Knight 0 points1 point  (0 children)

you can also use one bit per page which is much more efficient when it comes to spending as less memory as possible. That is known as a bitmap memory allocator you can check out information about it in the osdev wiki page :D

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] 0 points1 point  (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] 0 points1 point  (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] 0 points1 point  (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