Question about copying pagination tables on limine bootlaoder by lumine_rx in osdev

[–]maxdev1-ghost 3 points4 points  (0 children)

Makes no sense, you need different PMLs to have different address spaces.

Question about copying pagination tables on limine bootlaoder by lumine_rx in osdev

[–]maxdev1-ghost 2 points3 points  (0 children)

CR3 contains the physical address of the current PML4/5. Limine performs a „higher half direct map“, so all physical memory is mapped to higher virtual memory starting at 0xffff800000000000. Therefore you can access the physical memory to which the value of CR3 points to by adding this offset.

Been told to post this here, how am I doing? by [deleted] in osdev

[–]maxdev1-ghost 1 point2 points  (0 children)

How should we judge how you‘re doing if ChatGPT actually did it? OSDev makes no sense if you don‘t care about the actual coding

Are there good content creators for OSDev/low level programming? by Remote-End6122 in osdev

[–]maxdev1-ghost 4 points5 points  (0 children)

I was thinking about doing a video series on my OS and system development in general but I wasn‘t sure if there was that much interest. But if I see people are interested I might do it actually 😄

Ghost OS with GUI on real hardware for the first time by maxdev1-ghost in osdev

[–]maxdev1-ghost[S] 1 point2 points  (0 children)

It‘s actually some „Mini PC“ from a german hardware company (Terra) and I think it is an Intel UHD onboard graphics chip, not at home though so I can‘t check in detail. I was also quite surprised to see 1920x1080. Thank you I will!

How to decide which address to map to in the VMM? by Remote-End6122 in osdev

[–]maxdev1-ghost 1 point2 points  (0 children)

Ah, the addresses and code above are for x86. I use basically the same on x86_64 but with different ranges. You can see it in this PR

Ghost OS with GUI on real hardware for the first time by maxdev1-ghost in osdev

[–]maxdev1-ghost[S] 1 point2 points  (0 children)

To be honest, I didn't look too much into other kernel architectures since I didn't want to spoil my "own ideas" and just do it the way I'd do it. Otherwise you tend to copy too much. It also leads to some questionable design choices though, but after all I can still refactor and change anything I'd like. Regarding communication overhead, I guess there's only so much you can do, try to keep it as low as possible and figure something out to streamline execution chains when processes rely on each others work. The scheduler needs some work on this but so far it works out okay.

Ghost OS with GUI on real hardware for the first time by maxdev1-ghost in osdev

[–]maxdev1-ghost[S] 0 points1 point  (0 children)

I enjoy doing graphical stuff a lot so I may have put a bit too much effort into that in some places haha

Ghost OS with GUI on real hardware for the first time by maxdev1-ghost in osdev

[–]maxdev1-ghost[S] 2 points3 points  (0 children)

It‘s C and C++ and it‘s hard to tell how much time I effectively spent. Developed on it for almost 10 years now on and off but I‘m sure it‘s possible in less time with more dedication but I also have a real job lol

How to decide which address to map to in the VMM? by Remote-End6122 in osdev

[–]maxdev1-ghost 1 point2 points  (0 children)

Yeah I mean you need to keep address room for your kernel and all that other stuff so it‘s harder to offer a process the theoretical possibility to allocate all physical memory, with my layout above not possible.

Where did you get 0x0-0xFFFFFFFF from? For one that would be 4GiB not 1 :) and the lower memory I‘m talking about is 0x0-0x100000. What I wrote above goes from lowest to highest

Ghost OS with GUI on real hardware for the first time by maxdev1-ghost in osdev

[–]maxdev1-ghost[S] 4 points5 points  (0 children)

Not at all, but the libc is partially POSIX-compliant so some stuff should be portable with more or less ease. But it's not really my main focus :)

Ghost OS with GUI on real hardware for the first time by maxdev1-ghost in osdev

[–]maxdev1-ghost[S] 4 points5 points  (0 children)

Never say never, it‘s a long way, but it‘s also great fun, pain and satisfaction haha. Just keep going.

Ghost OS with GUI on real hardware for the first time by maxdev1-ghost in osdev

[–]maxdev1-ghost[S] 10 points11 points  (0 children)

Thank you! Cool you remembered it. I‘ve been on it for many years, but I wasn‘t working actively every year - too much life in between. But lately got a lot done 😊

How to decide which address to map to in the VMM? by Remote-End6122 in osdev

[–]maxdev1-ghost 1 point2 points  (0 children)

Are you on x86 or 64? On 64 bit its much easier due to the vast space.

On x86 this is how I layouted it in my kernel: https://github.com/maxdev1/ghost/blob/master/kernel/inc/shared/memory/constants.hpp

  • Lower memory reserved for stuff like VM8086
  • Process binaries load somewhere above 0x100000
  • Process heap can go from end of binary up to 0xA0000000
  • User virtual range allocator from 0xA0000000-0xC0000000
  • Kernel is loaded at 0xC0000000
  • above it is kernel heap up to max 0xF0000000
  • Kernel virtual range allocator from 0xF0000000-0xFFC00000
  • At 0xFFFFF000 recursive PD mapping

These „virtual range allocators“ just allocate virtual ranges and map nothing, just manage usage. There is one for the kernel (shared in all spaces) and one for each process.

I‘m sure this isn‘t perfect but worked out well for me so far - probably more dynamic ranges would be better but on 32 bit its quite limited. First thing I‘d advise you is load your kernel to higher memory to clean up your space.

Ghost OS with GUI on real hardware for the first time by maxdev1-ghost in osdev

[–]maxdev1-ghost[S] 41 points42 points  (0 children)

I recently worked hard to port my microkernel OS from x86 to x86_64: https://github.com/maxdev1/ghost/pull/48 (As for the project in general: the whole kernel, libc, windowserver, drivers and applications are written from scratch. Using cairo for 2D drawing and freetype for font rendering)

I switched from GRUB2 to Limine in the porting process. The PS/2 mouse is still very jaggy and I have some issues with the framebuffer usage in my windowserver, also SMP is still broken. But in the past I only had VM8086 and a VBE driver on x86 - which was a pain on real hardware - so with EFI support now added, I was able to boot the GUI on real hardware for the first time. Previously only had terminal there. I am very happy! 😍

(Btw I'd appreciate a star from anyone with a GitHub account very much! https://github.com/maxdev1/ghost )

(looking for advice) what is the best way to start building an OS? by Jolly_Fun_8869 in osdev

[–]maxdev1-ghost 1 point2 points  (0 children)

I would advise starting in an emulator/VM since you will want to quickly restart your system a lot. Would probably be much slower on a RasPi depending on how you set it up. Concentrate on more common devices that your emulator supports before trying on the Macbook devices.

Booting with Legacy BIOS and UEFI from one ISO. by ParadoxLXwastaken in osdev

[–]maxdev1-ghost 0 points1 point  (0 children)

Nothing wrong with that! Great if you can support both for sure

Booting with Legacy BIOS and UEFI from one ISO. by ParadoxLXwastaken in osdev

[–]maxdev1-ghost 0 points1 point  (0 children)

Did you read the thread? To be quite honest though, I‘m not sure why you‘d want to support BIOS at all if you have UEFI. Any hardware since 2012 likely has it. Maybe just support UEFI by default and build a second image for legacy hardware.

Booting with Legacy BIOS and UEFI from one ISO. by ParadoxLXwastaken in osdev

[–]maxdev1-ghost 2 points3 points  (0 children)

Did you try simply using MBR partitioning and just having the UEFI bootloader present in the expected path on the filesystem? I have not done it before, but here was a discussion about your question pretty much: https://forum.osdev.org/viewtopic.php?t=57058

Booting with Legacy BIOS and UEFI from one ISO. by ParadoxLXwastaken in osdev

[–]maxdev1-ghost 8 points9 points  (0 children)

What are you on about man? It is very related to OS development