What was the hardest thing to implement?

Programming, for all ages and all languages.
Post Reply
Synon
Member
Member
Posts: 169
Joined: Sun Sep 06, 2009 3:54 am
Location: Brighton, United Kingdom

What was the hardest thing to implement?

Post by Synon »

This isn't really a "HELP ME" question so I put it in the semi-off-topic section.

Just out of interest, what was the hardest thing in your kernel(s) to implement?

I'm anticipating that the network driver will be the most difficult (I'm not writing an OS (yet), just a bootable terminal emulator so it only needs a keyboard, screen and network driver.).
User avatar
thepowersgang
Member
Member
Posts: 734
Joined: Tue Dec 25, 2007 6:03 am
Libera.chat IRC: thePowersGang
Location: Perth, Western Australia
Contact:

Re: What was the hardest thing to implement?

Post by thepowersgang »

Sofar for me it's been a tie between TCP and UDI
The network driver itself was rather simple, it's the protocols that run on top of it that are hard.
As for UDI, I just can't seem to get my head around it, but I reckon I will get it eventually.
Kernel Development, It's the brain surgery of programming.
Acess2 OS (c) | Tifflin OS (rust) | mrustc - Rust compiler
Currently Working on: mrustc
Synon
Member
Member
Posts: 169
Joined: Sun Sep 06, 2009 3:54 am
Location: Brighton, United Kingdom

Re: What was the hardest thing to implement?

Post by Synon »

thepowersgang wrote:Sofar for me it's been a tie between TCP and UDI
The network driver itself was rather simple, it's the protocols that run on top of it that are hard.
As for UDI, I just can't seem to get my head around it, but I reckon I will get it eventually.
I was considering the TCP/IP stack and network driver as the same thing.
User avatar
gravaera
Member
Member
Posts: 737
Joined: Tue Jun 02, 2009 4:35 pm
Location: Supporting the cause: Use \tabs to indent code. NOT \x20 spaces.

Re: What was the hardest thing to implement?

Post by gravaera »

Proper memory management is one of the biggest obstacles you'll face, IMHO. Your definition of "proper" memory management could be very different from mine, though. But after you've done a proper MM, you should really have no further hassles with the actual kernel. Leaving the kernel though, yes: I agree that networking would be the next most challenging thing, though I'm nowhere close to networking in my current kernel.

--Nice topic,
gravaera
17:56 < sortie> Paging is called paging because you need to draw it on pages in your notebook to succeed at it.
Synon
Member
Member
Posts: 169
Joined: Sun Sep 06, 2009 3:54 am
Location: Brighton, United Kingdom

Re: What was the hardest thing to implement?

Post by Synon »

gravaera wrote:Proper memory management is one of the biggest obstacles you'll face, IMHO. Your definition of "proper" memory management could be very different from mine, though. But after you've done a proper MM, you should really have no further hassles with the actual kernel. Leaving the kernel though, yes: I agree that networking would be the next most challenging thing, though I'm nowhere close to networking in my current kernel.

--Nice topic,
gravaera
I won't need proper memory management for a terminal emulator, will I?

Also, how difficult is an ATA/IDE/SCSi driver?
pcmattman
Member
Member
Posts: 2566
Joined: Sun Jan 14, 2007 9:15 pm
Libera.chat IRC: miselin
Location: Sydney, Australia (I come from a land down under!)
Contact:

Re: What was the hardest thing to implement?

Post by pcmattman »

I would say the hardest thing I've personally dealt with in OS development would have to be a tie between TCP and a POSIX subsystem.

The only planned feature I'm particularly worried about being difficult is page swapping to disk. That'll be fun when I finally get to it :)
User avatar
gravaera
Member
Member
Posts: 737
Joined: Tue Jun 02, 2009 4:35 pm
Location: Supporting the cause: Use \tabs to indent code. NOT \x20 spaces.

Re: What was the hardest thing to implement?

Post by gravaera »

Synon wrote: I won't need proper memory management for a terminal emulator, will I?
Well, that depends on how meticulous you are about design: it's unlikely that you load your kernel into low memory, where the VGA function's framebuffer resides, and it's also unlikely that you load it into the very high reaches of the physical address space to make it easier to access PCI; From a pure design standpoint, the idea of mapping your kernel out in virtual memory as reaching backwards one whole megabyte on every architecture simply because it's convenient to do that on the IBM-PC is unacceptable.

Proper design would dictate that you not have the 1st 1MB mapped along with the kernel, and that your memory manager be called by whichever code handles the video device to map the relevant video device into its address space. So with that in mind, you would need a virtual memory manager before you have access to arbitrary locations in RAM, such as the VGA framebuffer, or a VBE framebuffer, or a PCI graphics card framebuffer. Demand mapping is way more efficient since you can free up space in the kernel address space (assuming you use monolithic modules) when the VGA driver isn't actually functioning.

Again, it all depends on how stringent your rules about proper design are :|

--All the best,
gravaera
17:56 < sortie> Paging is called paging because you need to draw it on pages in your notebook to succeed at it.
User avatar
Creature
Member
Member
Posts: 548
Joined: Sat Dec 27, 2008 2:34 pm
Location: Belgium

Re: What was the hardest thing to implement?

Post by Creature »

gravaera wrote:Proper memory management is one of the biggest obstacles you'll face, IMHO. Your definition of "proper" memory management could be very different from mine, though. But after you've done a proper MM, you should really have no further hassles with the actual kernel. Leaving the kernel though, yes: I agree that networking would be the next most challenging thing, though I'm nowhere close to networking in my current kernel.

--Nice topic,
gravaera
I agree. At first it may seem simple, but creating a fully working (as in, it works as intended and correctly) MM (PMM, VMM, heap, possibly involving multithreading/multitasking) is a much larger task than it seems at first. Usually there are a lot of cases in e.g. heaps you didn't expect at first which turn out to be problematic later, after which you will need to come back and fix them.
When the chance of succeeding is 99%, there is still a 50% chance of that success happening.
User avatar
XanClic
Member
Member
Posts: 138
Joined: Wed Feb 13, 2008 9:38 am

Re: What was the hardest thing to implement?

Post by XanClic »

As for me, it is/was USB. Getting network just working (pretty ugly TCP/IP stack for IRC) was a lot easier and can be achieved in a week, I think.
Post Reply