Live data from Hacker News

After 5 days, my OS doesn't crash when I press a key

jvns.ca

21–30 of 90 posts

Re: After 5 days, my OS doesn't crash when I press a key

#21
I've never done OS programming, but something about this just tickles me. I think it's the way she cheerfully acknowledges screwing up constantly but still gamely keeps tackling the problem. To admit your mistakes without shame, and try again without bitterness--to lose your ego, in other words--is something I certainly aspire to, as a programmer and a human being.

Re: After 5 days, my OS doesn't crash when I press a key

#22

I'm guessing that a lot of the difficulty comes from the fact he's creating an OS for a PC, which is a pretty quirky and inconsistent architecture.

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.

Re: After 5 days, my OS doesn't crash when I press a key

#23
post #22

Earlier 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's quite disrespectful to call someone a 'he' when they are obviously a 'she.' This is only vaguely related to the recent discussion about 'they' for people of indeterminate gender.

It's also quite jarring to read; I was confused if the OP was speaking of someone else. People often point out grammar or factual mistakes, I see your parent as doing no different.

Re: After 5 days, my OS doesn't crash when I press a key

#24
post #22

Earlier quoted context omitted.

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's quite disrespectful to call someone a 'he' when they are obviously a 'she.' This is only vaguely related to the recent discussion about 'they' for people of indeterminate gender. It's also quite jarring to read; I was confused if the OP was speaking of someone else. People often point out grammar or factual mistakes, I see your parent as doing no different.

I was under the impression that banal grammar corrections are frowned upon here on HN, because they do nothing to further the topic or encourage interesting discussion. It's one of the reasons why Reddit is so tedious.

Re: After 5 days, my OS doesn't crash when I press a key

#25
post #24

Earlier quoted context omitted.

It's quite disrespectful to call someone a 'he' when they are obviously a 'she.' This is only vaguely related to the recent discussion about 'they' for people of indeterminate gender. It's also quite jarring to read; I was confused if the OP was speaking of someone else. People often point out grammar or factual mistakes, I see your parent as doing no different.

I was under the impression that banal grammar corrections are frowned upon here on HN, because they do nothing to further the topic or encourage interesting discussion. It's one of the reasons why Reddit is so tedious.

Yeah, I mean, I downvote someone if they say "lol grammer stfu", but if it's part of a larger post, I don't think it's a bad thing.

I guess I see a blatant mis-gendering as not 'banal.'

Re: After 5 days, my OS doesn't crash when I press a key

#26
Another good read and really gives the insight on how much time and effort it takes to make anything happen on bare metal.

@jvns: SPOILERS AHEAD, DO NOT READ FURTHER IF YOU WANT TO GET TO THE HEART OF THIS PROBLEM YOURSELF

As for your problem with the keyboard interrupt firing only once, I think (after a quick glance over the code) that you do not signal "end of interrupt" (EOI) message to the 8259 PIC chip after you have received an interrupt. I faintly recall having this same issue in my ordeals with the PIC chip, if you don't signal EOI, the PIC won't fire the next keyboard interrupt.

Although I think I was working with 8253/8254 PIT (Programmable Interval Timer) chip at the time but I think the same applies to the keyboard interrupt too, it's being handled by the PIC too.

Here's the relevant part from my project: https://github.com/rikusalminen/danjeros/blob/master/src/arc... https://github.com/rikusalminen/danjeros/blob/master/src/arc...

I'm sorry to spoil your "fun" debugging it.

Dealing with any of this is a fun exercise in being close to the metal but unfortunately has no application in modern computers because these days the built-in IO-APIC/LAPIC has replaced the legacy PIC chip.

Re: After 5 days, my OS doesn't crash when I press a key

#27
post #14

Earlier quoted context omitted.

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 -…

0xB8000, to be precise. This is 16-bit 8086 legacy, where addresses were 20-bit and segmented. The most fun mode was mode 0x13 from INT 0x10, with its fantastic 320x200 resolution and 256 colors. That one had the buffer at 0xA0000.

Oh mode 0x13 and warm memories. Super easy to get working, as well, just an interrupt and start writing pixels to memory. Would probably be one of the first thing I'd do if I were to write a kernel.

Re: After 5 days, my OS doesn't crash when I press a key

#29
post #22

Earlier 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.

Misgendering people is disrespectful to them, and particularly so when a woman is being misgendered as a man because she is writing about something technical.

Re: After 5 days, my OS doesn't crash when I press a key

#30
>Press keys. Nothing happens. Hours pass. Realize interrupts are turned off and I need to turn them on.

>THE OS IS STILL CRASHING WHEN I PRESS A KEY. This continues for 2 days. Remember that now that I have remapped interrupt 1 to interrupt 33 and I need to update my IDT.

I have issues like this a lot (i.e. forgetting I've tweaked something and wondering what is causing weird effects). Any advice on how to avoid it?

Post reply on HN