What does your OS look like? (Screen Shots..)

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
User avatar
crunch
Member
Member
Posts: 81
Joined: Wed Aug 31, 2016 9:53 pm
Libera.chat IRC: crunch
Location: San Diego, CA

Re: What does your OS look like? (Screen Shots..)

Post by crunch »

f2 wrote:Finally got my 64-bit OS working! I had many troubles with paging. Implementing "recursive mapping" helped me a lot.
I'm focusing now on the 64-bit version. Next big step: adding UEFI support (won't be easy).
Obsidian64.jpg
Looks nice. I recently moved everything over to 64 bit as well. I'm at a stumbling block with recursive mapping though... Are you using mcmodel=large or kernel? I've played around with both, and can't seem to wrap my head around how to do the recursive mapping properly when using mcmodel=kernel
User avatar
f2
Member
Member
Posts: 311
Joined: Mon Jun 15, 2009 10:01 am
Location: France

Re: What does your OS look like? (Screen Shots..)

Post by f2 »

crunch wrote:
f2 wrote:Finally got my 64-bit OS working! I had many troubles with paging. Implementing "recursive mapping" helped me a lot.
I'm focusing now on the 64-bit version. Next big step: adding UEFI support (won't be easy).
Obsidian64.jpg
Looks nice. I recently moved everything over to 64 bit as well. I'm at a stumbling block with recursive mapping though... Are you using mcmodel=large or kernel? I've played around with both, and can't seem to wrap my head around how to do the recursive mapping properly when using mcmodel=kernel
I don't use gcc at all, my OS is entirely written in assembly!
"Open source seems to embrace the dark side of human nature." - Ville Turjanmaa
Korona
Member
Member
Posts: 999
Joined: Thu May 17, 2007 1:27 pm
Contact:

Re: What does your OS look like? (Screen Shots..)

Post by Korona »

crunch wrote:
f2 wrote:Finally got my 64-bit OS working! I had many troubles with paging. Implementing "recursive mapping" helped me a lot.
I'm focusing now on the 64-bit version. Next big step: adding UEFI support (won't be easy).
Obsidian64.jpg
Looks nice. I recently moved everything over to 64 bit as well. I'm at a stumbling block with recursive mapping though... Are you using mcmodel=large or kernel? I've played around with both, and can't seem to wrap my head around how to do the recursive mapping properly when using mcmodel=kernel
-mcmodel only affects the size of offsets that GCC generates, for example to access variables in your static data segment. In particular it does not interact with paging it all (other than restricting the addresses you can link your kernel to). -mcmodel should always be set to kernel (unless your static kernel image is larger than 2 GiB but I really hope that this is not the case :)). It does not restrict the pointers you handle yourself.
managarm: Microkernel-based OS capable of running a Wayland desktop (Discord: https://discord.gg/7WB6Ur3). My OS-dev projects: [mlibc: Portable C library for managarm, qword, Linux, Sigma, ...] [LAI: AML interpreter] [xbstrap: Build system for OS distributions].
User avatar
crunch
Member
Member
Posts: 81
Joined: Wed Aug 31, 2016 9:53 pm
Libera.chat IRC: crunch
Location: San Diego, CA

Re: What does your OS look like? (Screen Shots..)

Post by crunch »

Korona wrote:
crunch wrote:
f2 wrote:Finally got my 64-bit OS working! I had many troubles with paging. Implementing "recursive mapping" helped me a lot.
I'm focusing now on the 64-bit version. Next big step: adding UEFI support (won't be easy).
Obsidian64.jpg
Looks nice. I recently moved everything over to 64 bit as well. I'm at a stumbling block with recursive mapping though... Are you using mcmodel=large or kernel? I've played around with both, and can't seem to wrap my head around how to do the recursive mapping properly when using mcmodel=kernel
-mcmodel only affects the size of offsets that GCC generates, for example to access variables in your static data segment. In particular it does not interact with paging it all (other than restricting the addresses you can link your kernel to). -mcmodel should always be set to kernel (unless your static kernel image is larger than 2 GiB but I really hope that this is not the case :)). It does not restrict the pointers you handle yourself.
I'm aware of that, but using mcmodel=kernel necessitates that you can't put the recursive mapping in the last entry. I just haven't been able to successfully implement recursive mapping at a different location, but then again, I haven't put too much effort into it yet
f2 wrote: I don't use gcc at all, my OS is entirely written in assembly!
Just curious, are you linking into elf format or just a flat binary blob?
gerryg400
Member
Member
Posts: 1801
Joined: Thu Mar 25, 2010 11:26 pm
Location: Melbourne, Australia

Re: What does your OS look like? (Screen Shots..)

Post by gerryg400 »

crunch wrote:I'm aware of that, but using mcmodel=kernel necessitates that you can't put the recursive mapping in the last entry. I just haven't been able to successfully implement recursive mapping at a different location, but then again, I haven't put too much effort into it yet
No it doesn't. What makes you think that?
If a trainstation is where trains stop, what is a workstation ?
User avatar
f2
Member
Member
Posts: 311
Joined: Mon Jun 15, 2009 10:01 am
Location: France

Re: What does your OS look like? (Screen Shots..)

Post by f2 »

crunch wrote:Just curious, are you linking into elf format or just a flat binary blob?
My kernel is just a plain binary file.
"Open source seems to embrace the dark side of human nature." - Ville Turjanmaa
robbiedobbie
Member
Member
Posts: 36
Joined: Fri May 16, 2014 2:40 pm
Libera.chat IRC: robbiedobbie

Re: What does your OS look like? (Screen Shots..)

Post by robbiedobbie »

crunch wrote: I'm aware of that, but using mcmodel=kernel necessitates that you can't put the recursive mapping in the last entry. I just haven't been able to successfully implement recursive mapping at a different location, but then again, I haven't put too much effort into it yet
You mean that putting your kernel on address -2gb results in not being able to recursive map your last entry. This however is no issue, just use another entry for recursive mapping (I used index 256). This gives me the following memory map:

Code: Select all

| Start            | End              | Usage                       |
| ---------------- | ---------------- | --------------------------- |
| ffff800000000000 | ffff808000000000 | Recursive pagetable mapping |
| ffff808000000000 | _kernelBegin     | Large static allocations    |
| _kernelBegin     | _kernelEnd       | Kernel image                |
| _kernelEnd       | ffffffffffffffff | Kernel heap                 |
In which obviously the usage is just a convention I'm using for my kernel. _kernelBegin is located at ffffffff80000000.

Calculating the address to acces a certain entry with the recursive mapping at a different entry can be done with:

Code: Select all

void* entriesToAddress(uint64_t pml4, uint64_t pdp, uint64_t pd, uint64_t pt) {
  uint64_t address = (pml4 << 39);

  if((address & (1ll << 47)) > 0) {
      //We need to sign extend
      address |= 0xFFFF000000000000UL;
    }

  address |= pdp << 30;
  address |= pd << 21;
  address |= pt << 12;
  return (void*)address;
}

//Querying the different pagetable levels:
PageMapLevel4* pml4 = (PageMapLevel4*)entriesToAddress(RECURSIVE_ENTRY, RECURSIVE_ENTRY, RECURSIVE_ENTRY, RECURSIVE_ENTRY);
PageDirectoryPointer* pdp = (PageDirectoryPointer*)entriesToAddress(RECURSIVE_ENTRY, RECURSIVE_ENTRY, RECURSIVE_ENTRY, pml4Entry);
PageDirectory* pd = (PageDirectory*)entriesToAddress(RECURSIVE_ENTRY, RECURSIVE_ENTRY, pml4Entry, pdpEntry);
PageTable* pt = (PageTable*)entriesToAddress(RECURSIVE_ENTRY, pml4Entry, pdpEntry, pdEntry);
User avatar
crunch
Member
Member
Posts: 81
Joined: Wed Aug 31, 2016 9:53 pm
Libera.chat IRC: crunch
Location: San Diego, CA

Re: What does your OS look like? (Screen Shots..)

Post by crunch »

robbiedobbie wrote: Calculating the address to acces a certain entry with the recursive mapping at a different entry can be done with:

Code: Select all

//Querying the different pagetable levels:
PageMapLevel4* pml4 = (PageMapLevel4*)entriesToAddress(RECURSIVE_ENTRY, RECURSIVE_ENTRY, RECURSIVE_ENTRY, RECURSIVE_ENTRY);
PageDirectoryPointer* pdp = (PageDirectoryPointer*)entriesToAddress(RECURSIVE_ENTRY, RECURSIVE_ENTRY, RECURSIVE_ENTRY, pml4Entry);
PageDirectory* pd = (PageDirectory*)entriesToAddress(RECURSIVE_ENTRY, RECURSIVE_ENTRY, pml4Entry, pdpEntry);
PageTable* pt = (PageTable*)entriesToAddress(RECURSIVE_ENTRY, pml4Entry, pdpEntry, pdEntry);
Thanks, this snippet of code cleared it up for me!
User avatar
Sik
Member
Member
Posts: 251
Joined: Wed Aug 17, 2016 4:55 am

Re: What does your OS look like? (Screen Shots..)

Post by Sik »

Finally added something to the taskbar:

Image

Since this thing is single tasking (eventually having programs save their state when quitting so they can be restored when loaded back), all the "Apps" button does is just load the desktop application (what you see here). Really, not different from the home button on modern phones. Still seeing what to do with the rest of the taskbar (the idea was to add icons for recent programs but not sure how that'd pan out).

As for the calculator, got multiplication working now =P
User avatar
MajickTek
Member
Member
Posts: 101
Joined: Sat Dec 17, 2016 6:58 am
Libera.chat IRC: MajickTek
Location: The Internet
Contact:

Re: What does your OS look like? (Screen Shots..)

Post by MajickTek »

Sik wrote:Finally added something to the taskbar:

Image

Since this thing is single tasking (eventually having programs save their state when quitting so they can be restored when loaded back), all the "Apps" button does is just load the desktop application (what you see here). Really, not different from the home button on modern phones. Still seeing what to do with the rest of the taskbar (the idea was to add icons for recent programs but not sure how that'd pan out).

As for the calculator, got multiplication working now =P
Now that is really cool. I never even thought of something like that!
Everyone should know how to program a computer, because it teaches you how to think! -Steve Jobs

Code: Select all

while ( ! ( succeed = try() ) ); 
User avatar
MajickTek
Member
Member
Posts: 101
Joined: Sat Dec 17, 2016 6:58 am
Libera.chat IRC: MajickTek
Location: The Internet
Contact:

Re: What does your OS look like? (Screen Shots..)

Post by MajickTek »

szhou42 wrote:https://github.com/szhou42/osdev
My first GUI =D> =D> (looks familiar? :wink: )
Image
It looks almost like the beginnings of ToaruOS to me. Nice work! I think the buttons are upside-down (light goes on top?) Other than that, it's simply amazing.
Everyone should know how to program a computer, because it teaches you how to think! -Steve Jobs

Code: Select all

while ( ! ( succeed = try() ) ); 
prasoc
Member
Member
Posts: 30
Joined: Fri Feb 10, 2017 8:25 am

Re: What does your OS look like? (Screen Shots..)

Post by prasoc »

my first baby steps here. just got drawing pixels and terminal font support in :)

working on implementing a filesystem now, then I can finally start developing a way to open "windows" (small buffers of memory that you can draw on)

one question however: what is the best way to achieve screen "updates"? do you have a ticker that updates once every 1/60th a second or something?

Image
User avatar
BrightLight
Member
Member
Posts: 901
Joined: Sat Dec 27, 2014 9:11 am
Location: Maadi, Cairo, Egypt
Contact:

Re: What does your OS look like? (Screen Shots..)

Post by BrightLight »

prasoc wrote:one question however: what is the best way to achieve screen "updates"? do you have a ticker that updates once every 1/60th a second or something?
Personally, I redraw the screen whenever it needs an update, which is whenever the mouse cursor is moved, a window is dragged, or an application specifically requests a redraw after writing to the window canvas. I also support a locking technique that prevents the screen from being updated until the back buffer is entirely ready to be displayed. A heavily optimized SSE memcpy is always useful here. :P
You know your OS is advanced when you stop using the Intel programming guide as a reference.
User avatar
zesterer
Member
Member
Posts: 59
Joined: Mon Feb 22, 2016 4:40 am
Libera.chat IRC: zesterer
Location: United Kingdom
Contact:

Re: What does your OS look like? (Screen Shots..)

Post by zesterer »

omarrx024 wrote:
prasoc wrote:one question however: what is the best way to achieve screen "updates"? do you have a ticker that updates once every 1/60th a second or something?
Personally, I redraw the screen whenever it needs an update, which is whenever the mouse cursor is moved, a window is dragged, or an application specifically requests a redraw after writing to the window canvas. I also support a locking technique that prevents the screen from being updated until the back buffer is entirely ready to be displayed. A heavily optimized SSE memcpy is always useful here. :P
Presumably though it doesn't redraw on *every* update though? You'd end up redrawing a ridiculous number of times. I presume it's capped at something reasonable like 50-60Hz?
Current developing Tupai, a monolithic x86 operating system
http://zesterer.homenet.org/projects.shtml
User avatar
SpyderTL
Member
Member
Posts: 1074
Joined: Sun Sep 19, 2010 10:05 pm

Re: What does your OS look like? (Screen Shots..)

Post by SpyderTL »

prasoc wrote:my first baby steps here. just got drawing pixels and terminal font support in :)

working on implementing a filesystem now, then I can finally start developing a way to open "windows" (small buffers of memory that you can draw on)

one question however: what is the best way to achieve screen "updates"? do you have a ticker that updates once every 1/60th a second or something?
That's really impressive. How long have you been working on this?

In some ways, you're ahead of me, and I've been doing this for around 8 years now...

The easiest approach is just to redraw everything as needed, but it's too slow for every day use.

Depending on whether you want to support transparency or non-rectangular render boundaries, there are some tricks you can use to speed things up. But essentially, you just want to update only what is strictly necessary, and draw things in reverse order, from furthest to nearest.

Eventually, if/when you get access to 2D/3D hardware acceleration, then you can really speed things up and add some impressive effects. But that's really probably one of the last things you should spend time on.

Still, nice work!
Project: OZone
Source: GitHub
Current Task: LIB/OBJ file support
"The more they overthink the plumbing, the easier it is to stop up the drain." - Montgomery Scott
Post Reply