Biggest Blunder?

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
deleted
Member
Member
Posts: 82
Joined: Mon Jul 21, 2014 7:23 pm

Biggest Blunder?

Post by deleted »

Hey guys!

What's the biggest blunder for you during OSDev? I just deleted everything but a little GDT code with a mistyped makefile target #-o


Cheers,

Walt
glauxosdever
Member
Member
Posts: 501
Joined: Wed Jun 17, 2015 9:40 am
Libera.chat IRC: glauxosdever
Location: Athens, Greece

Re: Biggest Blunder?

Post by glauxosdever »

Hi,


To start, one my blunders was reverting a commit in a way that reverted also the files in my current directory to that commit. Fortunately I didn't revert it on remote, so I had an online backup.


Next, as many here know, during the initialisation of the PS/2 mouse we need to set the rates in a sequence to see if the mouse is something more than a standard one. There are two sequences:

Code: Select all

200, 100, 80
200, 200, 80
Except I wrote:

Code: Select all

200, 100, 80
200, 100, 80
And finally the biggest one: The ultimate blunder. I also like how I ignored the compiler warning about using an uninitialised variable.


Regards,
glauxosdever
User avatar
BrightLight
Member
Member
Posts: 901
Joined: Sat Dec 27, 2014 9:11 am
Location: Maadi, Cairo, Egypt
Contact:

Re: Biggest Blunder?

Post by BrightLight »

Well, thankfully i've never done anything that broke my OS or deleted code, and I've always been able to restore my previous state.
I was once improving ATA performance in QEMU, and I did improve it majorly... only to find out I just broke it in VirtualBox. :mrgreen:
Not sure if this is considered, but I was more sleepy than awake around 3 AM one night and I copied the TSS code from my 32-bit OS and used it in my 64-bit OS and spent some time wondering why it keeps triple fauling after an invalid TSS exception from userspace. :lol:
Then of course I noticed what I just did, so I got some sleep and next morning headed to Intel's manual.
Oh, and of course when my 24-bit clear_screen routine cleared only the top left pixel of the screen, and made this cool effect (would have been cooler with alpha blending, maybe I'll try it):
wm crazy.png
wm crazy.png (10.57 KiB) Viewed 4937 times
You know your OS is advanced when you stop using the Intel programming guide as a reference.
User avatar
deleted
Member
Member
Posts: 82
Joined: Mon Jul 21, 2014 7:23 pm

Re: Biggest Blunder?

Post by deleted »

glauxosdever wrote:Snip
Haha thats an awesome screenshot :D
omarrx024 wrote:Snip
That would look great with alpha blending, or if you added lighting that darkened the more windows were stacked... :)


Cheers,
Walt
User avatar
SpyderTL
Member
Member
Posts: 1074
Joined: Sun Sep 19, 2010 10:05 pm

Re: Biggest Blunder?

Post by SpyderTL »

A few years ago, I wasn't paying close enough attention to my custom written "raw" stream writer code that I wrote to "install" my bootable image to a USB drive, and I accidentally overwrote my MBR on my secondary hard drive that had all of my "data" (i.e. non-windows system files) on it. Luckily, I had my OS project in source control, but I did lose several projects that I had started, but never backed up, that I still wish to this day I could get back.

I primarily stick to ISO images, nowadays.
Project: OZone
Source: GitHub
Current Task: LIB/OBJ file support
"The more they overthink the plumbing, the easier it is to stop up the drain." - Montgomery Scott
User avatar
BrightLight
Member
Member
Posts: 901
Joined: Sat Dec 27, 2014 9:11 am
Location: Maadi, Cairo, Egypt
Contact:

Re: Biggest Blunder?

Post by BrightLight »

Walt wrote:That would look great with alpha blending, or if you added lighting that darkened the more windows were stacked... :)
If you say so.
crazy alpha.png
You know your OS is advanced when you stop using the Intel programming guide as a reference.
zdz
Member
Member
Posts: 47
Joined: Tue Feb 10, 2015 3:36 pm

Re: Biggest Blunder?

Post by zdz »

I always compile with trat warnings as errors. I know that I'm going to screw up and do something stupid.

Not OS-dev per se, but when I started to learn about virtualization I spent 4-5 days trying to figure out why Windows will stay in an infinite loop at startup. It turned out that I had left a device (I think it was the PIT) in a state that wasn't expected by Windows. At least I ended up with a pretty neat debugger after all that.
Another thing on which I lost almost one day was that every OS I tried to boot halted with "not enough memory available" just to discover that I had marked all the entries in the memory map as reserved.

I still have the bad habbit of writing the correct comment and the wrong line of code below it and to always skip those when I'm looking for mistakes.
For example (just from a few days back, thank you git for storing my mistakes forever :D ):

Code: Select all

// 16-bit, so the address will be (segment << 4) + offset
address = (segment << 3) + offset;
It took me 30-40 minutes to find that.
Kevin
Member
Member
Posts: 1071
Joined: Sun Feb 01, 2009 6:11 am
Location: Germany
Contact:

Re: Biggest Blunder?

Post by Kevin »

Walt wrote:What's the biggest blunder for you during OSDev? I just deleted everything but a little GDT code with a mistyped makefile target #-o
I hope you started to use version control now and push to an external repository regularly after this experience. :)
Developer of tyndur - community OS of Lowlevel (German)
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: Biggest Blunder?

Post by Combuster »

Probably my biggest one I recall was when I updated my ramdisk-initialisation code and ended up running it before the A20 code. This lingered for a long time with no issue because the load address for the thing was 4M, but I managed to hit the size limit at the same time I was testing compiler instrumentation flags.

In other words, enabling stack canaries made the system unbootable. Only on real hardware. And of course every post-mortem diagnostic said that A20 was enabled...
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
Techel
Member
Member
Posts: 215
Joined: Fri Jan 30, 2015 4:57 pm
Location: Germany
Contact:

Re: Biggest Blunder?

Post by Techel »

I had deleted some of my code, but luckily I had github already set up.
User avatar
deleted
Member
Member
Posts: 82
Joined: Mon Jul 21, 2014 7:23 pm

Re: Biggest Blunder?

Post by deleted »

Kevin wrote:I hope you started to use version control now and push to an external repository regularly after this experience. :)
That's just the problem, I have Gitlab setup, but I haven't pushed to it in a week! Anyways, lesson learned.
glauxosdever
Member
Member
Posts: 501
Joined: Wed Jun 17, 2015 9:40 am
Libera.chat IRC: glauxosdever
Location: Athens, Greece

Re: Biggest Blunder?

Post by glauxosdever »

Hi,


Just now something else happened. While I mapped the whole data used by the kernel and marked as free the rest of physical memory, I...

...forgot to map the framebuffer. :shock:

Wondering the whole afternoon why did it triple fault.


Regards,
glauxosdever
User avatar
deleted
Member
Member
Posts: 82
Joined: Mon Jul 21, 2014 7:23 pm

Re: Biggest Blunder?

Post by deleted »

glauxosdever wrote:Snip
Uh oh!

Don't you have an IDT, and ISR setup?
glauxosdever
Member
Member
Posts: 501
Joined: Wed Jun 17, 2015 9:40 am
Libera.chat IRC: glauxosdever
Location: Athens, Greece

Re: Biggest Blunder?

Post by glauxosdever »

Hi,

Walt wrote:
glauxosdever wrote:Snip
Uh oh!

Don't you have an IDT, and ISR setup?
I do. But the panic function writes to the framebuffer too, so it double faulted and then it triple faulted.


Regards,
glauxosdever
User avatar
deleted
Member
Member
Posts: 82
Joined: Mon Jul 21, 2014 7:23 pm

Re: Biggest Blunder?

Post by deleted »

Hey!
glauxosdever wrote:Snip
Haha I see... Should have thought of that. I just booted my OS in bochs to test my new hardware IRQ code... Well, I clicked all the buttons on the top row (left to right), until I hit the mouse button. I basically got a bunch of "Handled interrupt #(x)" until I figured out how to exit.

OSDev =D>
Post Reply