Multitasking Issues

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
Ycep
Member
Member
Posts: 401
Joined: Mon Dec 28, 2015 11:11 am

Re: Multitasking Issues

Post by Ycep »

octacone wrote:
Lukand wrote:Slow down runner! You go to multitasking without having any filesystem, ELF/PE executer nor memory manager!
That multitasking on wiki almost isn't multitasking at all. It only switches registers and task when one task finishes it task. Multitasking is more like, for example giving one high priority task 800ms (so called 80% of CPU) and 200ms (20%) to low priority tasks, and breaking them in execution if their time is done and going to next task!
"Copying and pasting code without knowing what it does..." ...is bad.
Why did you respond to this doe? This topic is paused until I figure out some other more important stuff. Again I HAVE a working memory manager. I do NOT need an executor at the moment. No, that is a concept called priority multitasking. Multitasking is really what you want it to be. Don't worry I know what the code does (expect for couple of machine instructions), I fully understand the concept of multitasking. I think that not "syncing" the code causes this issue. (not all the parts are aware of each other) I think I will be able to figure this out in couple of weeks, as I said need to get some other things to work first.
Edit: can a file system without ability to read/write/manage files on a hard drive really be called so?
Concept of filesystem is ability to read and write files, not only on hard drive.
User avatar
BrightLight
Member
Member
Posts: 901
Joined: Sat Dec 27, 2014 9:11 am
Location: Maadi, Cairo, Egypt
Contact:

Re: Multitasking Issues

Post by BrightLight »

Implementing multitasking before a working filesystem driver and program loader is perfectly fine. Executing tasks from memory is fine and multitasking doesn't depend on the filesystem for anything. It is also possible to have a filesystem without a hard disk driver; which is the reason ramdisks exist.
Of course, after you implement a file system, then you will need to load programs from disk, but switching tasks itself doesn't depend on the filesystem.
You know your OS is advanced when you stop using the Intel programming guide as a reference.
User avatar
jojo
Member
Member
Posts: 138
Joined: Mon Apr 18, 2016 9:50 am
Libera.chat IRC: jojo
Location: New York New York

Re: Multitasking Issues

Post by jojo »

Yeah, mine is still running from a ramdisk while I work on getting core functions to work properly. I don't think there's anything wrong with that approach, but I guess I would be biased.
User avatar
Brendan
Member
Member
Posts: 8561
Joined: Sat Jan 15, 2005 12:00 am
Location: At his keyboard!
Contact:

Re: Multitasking Issues

Post by Brendan »

Hi,
jojo wrote:Yeah, mine is still running from a ramdisk while I work on getting core functions to work properly. I don't think there's anything wrong with that approach, but I guess I would be biased.
For a micro-kernel, during boot you have to load disk drivers and file system code from somewhere (before you have any disk drivers or file systems). To solve that, any drivers, etc that you need to access file systems must be loaded using firmware (e.g. by boot loader). Dealing with lots of small files is a pain, so it's natural to end up with some kind of "initial RAM disk".

For my case; the "initial RAM disk" is compressed (and decompressed by boot code) to improve performance (less disk IO); and it contains "boot modules" that are used during boot before kernel is started, and it contains one or more kernels (the boot code detects a few things, like if CPUs support long mode or not, and decides which kernel to start) which is extremely useful for some cases (e.g. generic "live CD").

I also use "initial RAM disk" to improve boot times. For example, maybe you want to put a video card driver and part of the GUI (e.g. the pieces needed for user login) into the "initial RAM disk" (even though they aren't strictly necessary because they can be loaded from disk); so that the OS can start the GUI while it's waiting for disk and file systems to be initialised.

Finally; I use "initial RAM disk" for some fault tolerance. For all files that were in the "initial RAM disk", the OS checks if they exist in the OS's file system and copies them to the file system if they don't exist. This means that if you accidentally wipe the OS's file system (or replace the hard drive or something) the OS's critical files (boot modules, kernels, etc) will be restored from the "initial RAM disk".


Cheers,

Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
User avatar
Ycep
Member
Member
Posts: 401
Joined: Mon Dec 28, 2015 11:11 am

Re: Multitasking Issues

Post by Ycep »

@octacone Althrough I would never say that cooperative multitasking is real multitasking, just preemptive one. The point was not on priority-based multitasking, but on that you are just doing some tasks in while(true) loop and that I won't call while(true) loop a multitasker.
Post Reply