Should I implement paging if my kernel is single-tasking?
Should I implement paging if my kernel is single-tasking?
Hi, so should I implement paging if I'm planning to make a single-task kernel? If not, should my next step be a file system?
Thanks
Thanks
Re: Should I implement paging if my kernel is single-tasking?
My opinion is yes, because even if it is single tasking, if you run a powerful app, you might need to swap stuff out of memory...
Jules
Jules
Re: Should I implement paging if my kernel is single-tasking?
This question seems rather silly?
You could do either first depending on your to-do list layout.
In fact, you should probably put both to the very top of your to-do list.
You could do either first depending on your to-do list layout.
In fact, you should probably put both to the very top of your to-do list.
Re: Should I implement paging if my kernel is single-tasking?
Hi,
I agree with Suthers - implement paging. Even if you are single tasking, do you have a kernel providing the application with services? If so, paging will offer you page-level memory protection - just because you only have one app doesn't necessarily mean that the app will behave itself
I think that even if you decide to implement paging next, you should still design your filesystem now. The reason? Whenever you design software, you always design the interface before implementing. The VFS will have quite a bearing on how your application "sees" your kernel and may have a bearing on how you want to implement paging (swapping and so on) - so by all means implement paging next, but design your kernel <--> user interfaces first.
HTH,
Adam
I agree with Suthers - implement paging. Even if you are single tasking, do you have a kernel providing the application with services? If so, paging will offer you page-level memory protection - just because you only have one app doesn't necessarily mean that the app will behave itself
This answer seems rather silly.Uranium wrote:This question seems rather silly?
You could do either first depending on your to-do list layout.
I think that even if you decide to implement paging next, you should still design your filesystem now. The reason? Whenever you design software, you always design the interface before implementing. The VFS will have quite a bearing on how your application "sees" your kernel and may have a bearing on how you want to implement paging (swapping and so on) - so by all means implement paging next, but design your kernel <--> user interfaces first.
HTH,
Adam
-
DeletedAccount
- Member

- Posts: 566
- Joined: Tue Jun 20, 2006 9:17 am
Re: Should I implement paging if my kernel is single-tasking?
It's your choice 
-
binarysemaphore
- Posts: 11
- Joined: Thu Jul 03, 2008 12:37 am
Re: Should I implement paging if my kernel is single-tasking?
So if you don't implement paging, how do you plan to accomodate applications which might require more than available memory ?osdf_1 wrote:Hi, so should I implement paging if I'm planning to make a single-task kernel? If not, should my next step be a file system?
Thanks
Tejas Kokje
Re: Should I implement paging if my kernel is single-tasking?
That's what I was pointing out, the answer is with a lot of difficulty... you'd need to make a malloc function that 'emulates' the page swap ability...binarysemaphore wrote:So if you don't implement paging, how do you plan to accomodate applications which might require more than available memory ?osdf_1 wrote:Hi, so should I implement paging if I'm planning to make a single-task kernel? If not, should my next step be a file system?
Thanks
Tejas Kokje
Jules
Re: Should I implement paging if my kernel is single-tasking?
Get real, this is such a crap argument, how much ram do most moden PC have, the old xbox run some big game, much bigger than anything that will run on a hobby OS and that was single-tasking without paging, there are so many advantages to not using paging, in a single-tasking OS.
I would say stay away from paging (if your coding a single-tasking OS).
I would say stay away from paging (if your coding a single-tasking OS).
Re: Should I implement paging if my kernel is single-tasking?
I have to agree with Dex though. In a simple OS you don't need paging and all that stuff. Makes your life easier from handling pagefaults and learning a completely new way of handling memory.
Segmentation (with PAE to access >4GB RAM) for the win.
Segmentation (with PAE to access >4GB RAM) for the win.
My web site: http://inflater.wz.cz (Slovak)
Derrick operating system: http://derrick.xf.cz (Slovak and English
)
Derrick operating system: http://derrick.xf.cz (Slovak and English
-
binarysemaphore
- Posts: 11
- Joined: Thu Jul 03, 2008 12:37 am
Re: Should I implement paging if my kernel is single-tasking?
Ok..if it is a simple OS which will run on a architecture with fixed amount of main memory, you can skip paging for single tasking kernel. But it is unfair for general purpose OS to assume that every computer will have at least X amount of main memory.Dex wrote:Get real, this is such a crap argument, how much ram do most moden PC have, the old xbox run some big game, much bigger than anything that will run on a hobby OS and that was single-tasking without paging, there are so many advantages to not using paging, in a single-tasking OS.
I would say stay away from paging (if your coding a single-tasking OS).
Other way would be for application developers to specify minimum memory requirement for your single tasking OS.
Tejas Kokje
Re: Should I implement paging if my kernel is single-tasking?
I'm inclined to agree with Dex as well. It's going to depend a lot on what you want to accomplish with the OS. If you want the OS to be as simple as possible, and will only run a single application at a time (or the same application all of the time), then it may not be necessary. You can probably assume that any modern desktop PC is going to have at least 512MB of RAM, and not many programs need more than that, even taking the OS into account (it's simple, right?).
If you suspect that an application running on it might need more RAM than that, it's going to be very difficult to deal with it, but you could emulate paging if it's needed. Swap out large chunks of memory or something if needed, and keep track of it in the kernel.
The other important feature of paging, as has been said, is memory protection. Not sure how you're going to deal with that though. You need to keep the application from writing to kernel memory, accessing hardware directly, or using priviledged instructions. That's harder to deal with without priviledge levels and all, and isn't that linked to paging? (seriously, I'm not sure, I haven't made it this far myself)
If you suspect that an application running on it might need more RAM than that, it's going to be very difficult to deal with it, but you could emulate paging if it's needed. Swap out large chunks of memory or something if needed, and keep track of it in the kernel.
The other important feature of paging, as has been said, is memory protection. Not sure how you're going to deal with that though. You need to keep the application from writing to kernel memory, accessing hardware directly, or using priviledged instructions. That's harder to deal with without priviledge levels and all, and isn't that linked to paging? (seriously, I'm not sure, I haven't made it this far myself)

