Citadel Redesign!

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.
Post Reply
elderK

Citadel Redesign!

Post by elderK »

Hey guys, anyone remember me? :)
The coffee obsessed programmaholic?

I took a little break from coding OSes and wrote a hobbyist 3D engine, which now is benched.

;) Back to OS Dev.

Im thinking of rewriting Citadel from scratch, and making it better.

But for this, I need some resources.
That being, some good information on Microkernels.

Id rather not look through sourcecode, id rather read through some books.

The problem being, Im a poor student and I cant afford any of them.

:) I remember there beign a PDF Repository with a lot of PDFs.

Anyone care to link me up?

Orrrr point me to some good resources on Microkernel developement?

Btw, Hi to all of you!
Andddd I hope all your projects are sailing along smoothly!

~Zeii
Seven11

Re:Citadel Redesign!

Post by Seven11 »

look at http://www.osdever.net/ under "Cottontail Archive" (that's the biiiiig archive), but also under sections "Tutorials" and "Documents".

Good luck!
elderK

Re:Citadel Redesign!

Post by elderK »

Hey again guys,

Im not really where to start.

You see, the current sourcebase of the Citadel Kernel does:

- Bootloader sets up GDT, PMode, Loads Kernel raw from disk.
- Kernel begins, sets up IDT, Exception Handling, ISR Handling
for some things, like the PIT.
- Initializes Basic Memory Management, Sets up Paging,
Enables Paging.
- Tests Physical Memory Allocation and Deallocation.

Thats where I got to with the last codebase.

Im thinking of doing a COMPLETE rewrite.
Although, I fail to see the point.

I want to make a nice little Hobbyist Microkernel, just...
Im having trouble getting a vision or anything at the moment.

:P Someone to guide my ideas slightly would be appreciated.

~Zeii.
User avatar
Candy
Member
Member
Posts: 3882
Joined: Tue Oct 17, 2006 11:33 pm
Location: Eindhoven

Re:Citadel Redesign!

Post by Candy »

That's also the point (up to some level) where I'm stuck right now. I decided to go for module loading first, then to write drivers, add user space and then to start writing libraries. I then designed some interface around everything, and now I'm busy implementing it all. Making it full circle - since I redesigned the booting & file system portions, I'm now implementing a boot loader.
distantvoices
Member
Member
Posts: 1600
Joined: Wed Oct 18, 2006 11:59 am
Location: Vienna/Austria
Contact:

Re:Citadel Redesign!

Post by distantvoices »

Currently I'm overhauling the GUI Subsystem.

BTW, zeii, I'm a student too, but not a poor one. Gaining my life in business, I'm devoting the evenings to study. That's cool, eh? There 's just a shortage of time I can spend on osdeving, you see? That's why blueillusionos looks like an abandoned project. There isn't anything visible happening. well I see the progress, no one else. A pity, but a bearable one.

as for micro kernel stuff: well, andrew tanenbaums books are a valuable source of information. You maybe can save some money for one? Ebay or so?

Ask away if you want to know something special. I've got no hankering to type at a lenghty rant about micro kernel stuff. I'm a lazy hog, I admit. *gruntgrunt*
... the osdever formerly known as beyond infinity ...
BlueillusionOS iso image
paulbarker

Re:Citadel Redesign!

Post by paulbarker »

Well, as someone on their 10th-15th complete re-write, I know what you mean. I always seem to stop around the point of memory management. It's to be expected though, when I started osdeving I had never written a non-trivial program before.

The best place to start for a microkernel is to decide just how 'micro' you want it. Which things will go in kernel mode, and which will be separate programs? Everyone has a different idea of where the line is drawn.

Have you read the Wikipedia entry for 'Microkernel'? Something like This may also be useful, which has a bunch of references at the bottom of the page.
elderK

Re:Citadel Redesign!

Post by elderK »

The Kernel will include drivers for only what it needs to get Servers up and running, once thats complete, all the drivers inside of the kernel will be ignored, and the servers will become the rulers of those areas. :P.

Of course, Kernel will still manage Memory, both physical and virtual, process management and IPC.

Man, im confused. Im not really sure how to provide protected memory. I was toying with the idea of giving each Process its own Page Directory, and map it so that the Kernel is there and the Application is there, nothing else.

VMM idea?
- VMM will use the PMM to allocate the Memory needed for an Application, Space for App code, and stack, and basic heap. VMM will map these locations. Only kernel and app will be in the PD.

- When the application is trying to allocate more ram, the VMM will use the PMM to allocate the space needed, and the VMM will map the location in the App PD to the correct place where the Allocated memory lies in the PMM.

Problem with this? Switching!
In order to do PMM, you need access to RAM, that isnt being all remapped all over the place. Itd switch to the Kernels Identiy Mapped PD. Then, allocate the ram, link it to the right places in the Applications PD, then switch back to the apps PD.

Im not sure, Advice would be appreciated.
So far, the CItadel PMM allocates what is needed, and keeps track of the free. its First Fit algorithim. It doesnt allocate a Page for every allocation, it allocates what is needed, and keeps the rest of the page in the free list, when you allocate or free, the free list changes to reflect that.

When a Page is about to be full, a new page is allocated.

*shrug* Man, im so nervous lately, it isnt cool. *sigh*

~Zeii, the 18 year old Nervous wreck.
JAAman

Re:Citadel Redesign!

Post by JAAman »

Problem with this? Switching!
In order to do PMM, you need access to RAM, that isnt being all remapped all over the place. Itd switch to the Kernels Identiy Mapped PD. Then, allocate the ram, link it to the right places in the Applications PD, then switch back to the apps PD.
im not sure why you would need identity-mapped memory -- the only reason you would need that, is if there is a specific physical memory location you need to access -- which shouldnt be needed for this

allocating the RAM doesnt require access in identity mapping, all you must do is track which physical pages are in use, grab one, and assign it to a virtual address (if you need to create a new page table, just allocate yourself an additional page, and use it for this (unless of course, you were planning to not map the page directory into virtual space? that is possible, but difficult, since, as you said, it requires a context switch to update the page tables)
So far, the CItadel PMM allocates what is needed, and keeps track of the free. its First Fit algorithim. It doesnt allocate a Page for every allocation, it allocates what is needed, and keeps the rest of the page in the free list, when you allocate or free, the free list changes to reflect that.
that sounds more like the job of malloc...
normally this is handled in user space (as part of the standard C library), and your memory manager only allocates pages, because you want to minimize the number of syscalls your application must make (now in kernel, you may need a 'malloc' implementation, but that is separate from the physical/virtual memory managers -- or rather built on them, just like in user space) -- partial pages really cant be reused elsewhere anyway (safely) -- at least not easily

of course, we all have our own ideas, and i cant shouldnt tell you how to do it
elderK

Re:Citadel Redesign!

Post by elderK »

:D Alrighty, New Bootloader chain is completed!

;) Time to do a test and see if I can boot the original Citadel Kernel through it!

:D Wish me luck!

~Zeii
Post Reply