Designing an organized system

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
john2496

Designing an organized system

Post by john2496 »

Okay, well I started working on my os a few days ago. I've actually been spending most of my time looking stuff up and reading tutorials than actually coding. Now that I've readup on the concepts its time for some actual coding :9.

However the first problem I'm facing is 'how should I structure this thing[codewise]'. I like my source code to be _very_ neat, orderly, and properly layered.

I'm writing up a list of functions I'm going to write and basically how this is going to be implemented. I'm trying to keep seperate parts of the operating system SEPERATE to avoid intermingling code.

Here is what I got so far. I'm asking for suggestions and your ideas on the various libraries that should be written.

Updated: 12-10 8:10am est

user_io.c
   k_get_char
   k_get_str
   k_print_char
   k_print_str

cursor.c
   k_move_left
   k_move_right
   k_move_up
   k_move_down
   k_get_current_position
User avatar
bubach
Member
Member
Posts: 1223
Joined: Sat Oct 23, 2004 11:00 pm
Location: Sweden
Contact:

Re:Designing an organized system

Post by bubach »

perhaps you should seperate the printing and keyboard functions, as you will need a irq etc for keyboard input?
"Simplicity is the ultimate sophistication."
http://bos.asmhackers.net/ - GitHub
distantvoices
Member
Member
Posts: 1600
Joined: Wed Oct 18, 2006 11:59 am
Location: Vienna/Austria
Contact:

Re:Designing an organized system

Post by distantvoices »

for the user input ... well as long as you are not fetching input from /console (I have four special devices: console1 - console4) via file system, you can as well build in hooks to fetch the characters directly from some kind of input queue (a circular buffer is the best solution for this. Its quick, clean and stable as hell - and easy to implement I use it for many other things too, the circular buffer structure)

Bubach is right btw: keyboard input and 'reading' a character from a device have to be separated strictly. You gonna have troubles if you choose to simplify too much, there's no two ways around that. You *read* from a console and you *write* to a console. Better you provide yourself with those abstractions as soon as possible. :-)

stay safe. I hope everything is clear still. :-))
... the osdever formerly known as beyond infinity ...
BlueillusionOS iso image
Post Reply