After 5 days, my OS doesn't crash when I press a key
41–50 of 90 posts
Re: After 5 days, my OS doesn't crash when I press a key
#42Nothing quite like trying to write a complex system from scratch to realise just how many giant shoulders you stand on every day.
I love this article: https://plus.google.com/112218872649456413744/posts/dfydM2Cn...
Re: After 5 days, my OS doesn't crash when I press a key
#43Earlier quoted context omitted.
I love this article: https://plus.google.com/112218872649456413744/posts/dfydM2Cn...
Now (re-)submitted as an item in its own right: https://news.ycombinator.com/item?id=6853813
Re: After 5 days, my OS doesn't crash when I press a key
#44Earlier quoted context omitted.
Now (re-)submitted as an item in its own right: https://news.ycombinator.com/item?id=6853813
It has been submitted several times before if I'm not mistaken, in fact I know it from HN.
* it's not been submitted for a long time,
* discussion there is closed,
* it's really good,
* it's technical, and
* it's relevant.
I commented about why I've resubmitted it here:
Re: After 5 days, my OS doesn't crash when I press a key
#45Earlier quoted context omitted.
The blog author is not a 'he' but a 'she.' Her name is mentioned through the article. And I'm guessing that the difficulty comes from the fact that she's building a freaking operating system from scratch... ;)
Is the gender of said author supposed to be curious or worthy of attention? I'm not intending to be impolite, but this is the third time in several days that HN posters have brusquely corrected a gender pronoun in relation to a submission of nondescript importance.
It shouldn't be. There are two things going on here:
* Perception of our industry as all-male biases women against joining
* Default use of 'He' exacerbates this by unsubtly signalling that our community is all-male
So why flag female hackers?
* To try to combat the perception of us being an all-male community (we're not)
* To signal to women and men that both genders can operate comfortably in this environment
Why do we want more women hackers?
* We are ignoring more than 50% of the programming talent in the world
Re: After 5 days, my OS doesn't crash when I press a key
#46I do remember the excitement of getting interrupts to work - good times. Getting task switching to work was magic.
Re: After 5 days, my OS doesn't crash when I press a key
#47Would echoing the chracter on screen require a seperate video driver to mark the pixels that make up the character ? Considering how hard is to make the keyboard driver, wouldn't the video driver be many folds harder?
Text mode is super easy - you just set bytes in the correct memory location (0xb8000000 if I remember correctly). Writing an actual graphics driver is tricky - although there are some ways to get decent frame buffer modes (like VESA Bios Extentions), to do things really well requires thousands of lines of code before you can even get a pixel on the screen, and is different for every card. It may be a bit easier now -…
In addition you have to be using I/O ports if you want to move the blinking cursor and other related stuff.
> Writing an actual graphics driver is tricky - although there are some ways to get decent frame buffer modes (like VESA Bios Extentions), to do things really well requires thousands of lines of code before you can even get a pixel on the screen, and is different for every card.
This is particularly painful because you have to switch back to real mode to be able to use VESA and other Bios interrupts.
Thankfully it's not required if you're using a good bootloader like GRUB (which you should if you're doing an OS project, writing another bootloader is just more arcane hardware to work around). The multiboot specification allows you to ask for a video framebuffer from the bootloader, and you'll get a physical memory address where the linear video framebuffer resides. I bet UEFI has something similar too.
So these days, with the help of your bootloader, doing graphics on a bare metal kernel is as easy as using the text mode.
Re: After 5 days, my OS doesn't crash when I press a key
#48Doing OS things is hard. In x86 it's extra hard
x86 is one kludge on top of another. Like interrupt chaining
These issues remind me of making a Sound Blaster card work on DOS (I was making a program to play a simple file in Pascal/C)
It's very complicated, and several trials to make it work (and no Stackoverflow, Wikis, etc)
Re: After 5 days, my OS doesn't crash when I press a key
#49How do OS developers typically debug this sort of thing? Do they attach external hardware to step through, or is it serial logging?
Re: After 5 days, my OS doesn't crash when I press a key
#50 > This continues for 2 days
This thing made me scoff at the article the most. I've written a unix-like OS for ARM 2 years ago as a final project for an OS class I took on campus. There were 20 other people in the class, and all of us forgot to update the IDT at some point. It was a common mistake, so for this article to emphasize it like it's some bug that takes 2 days is just lame.Imagine if my blog post would talk about my experiences with building an HTML page, and how it took me 2 days to change a
element to a . Let's get serious here.
How long will it take the author to write a circular buffer to read and write characters to the UART? A month? That says nothing about the difficulty of the actual task.
You know, when it comes to writing operating systems, I like to think of this quote: "it's hard, it's harder than it looks, but it ain't THAT hard" (I first heard it when the commentators were laughing at Chris Andersen was struggling to dunk in an NBA Dunk Contest).
If you're interested in writing an OS, make sure your primary source isn't some blog post. My textbook was Tannenbaum's Operating System book, and it's a very solid book that I can recommend. Tannenbaum knows operating systems. He's not going to tell you how hard it is. He's going explain all the details to you and, when you understand them, you'll think how easy kernels really are.
Good luck!