When your OS goes crazy - Screenshots

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
iansjack
Member
Member
Posts: 4703
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: When your OS goes crazy - Screenshots

Post by iansjack »

I find it difficult to believe that single-stepping showed ptr to have a non-null value but list->elements to be null after the assignment. Mind, I don't understand why the irrelevant variable ptr is used in the first place.
Synon
Member
Member
Posts: 169
Joined: Sun Sep 06, 2009 3:54 am
Location: Brighton, United Kingdom

Re: When your OS goes crazy - Screenshots

Post by Synon »

cyr1x wrote:I guess this bug does not occur when optimizations are disabled right?
I always develop with optimizations explicitly disabled. Once I'm done implementing and testing something with optimizations disabled, I re-enable them and test again.
iansjack wrote:I find it difficult to believe that single-stepping showed ptr to have a non-null value but list->elements to be null after the assignment. Mind, I don't understand why the irrelevant variable ptr is used in the first place.
ptr is just there to demonstrate that static_alloc is not returning NULL, yet list->elements is NULL. I haven't single-stepped it recently but I've definitely done it. I can't try again until I get my computer back though.

I also need to figure out why GDB says there are no debugging symbols in the debugging file I created, then shows debugging symbols for some of my functions but not all. The kernel is stripped, but before that, all the debugging symbols get objcopied to another file and a debug-link is added. It makes debugging very difficult, and that's why I haven't looked at it in the debugger recently.
User avatar
iansjack
Member
Member
Posts: 4703
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: When your OS goes crazy - Screenshots

Post by iansjack »

Well, there doesn't seem to be much point in introducing a variable just to capture the value of the static_alloc and single-stepping as well. Watching the variable whilst single-stepping should be enough.

When you get a chance, try single-stepping again. If ptr has a non-null value and list->elements also has a non-null value after the assignment (which it really has to from what you have told us), then I would look at the kprintf function to see if it has a bug that is corrupting the stack. If the unbelievable has happened, and the assignment is somehow failing, then it's time to look at the generated assembler code.
User avatar
sortie
Member
Member
Posts: 931
Joined: Wed Mar 21, 2012 3:01 pm
Libera.chat IRC: sortie

Re: When your OS goes crazy - Screenshots

Post by sortie »

Your printf is likely wrong. Your varargs passing might also be. If you make two nice fake pointers yourself, can you print them? Add attribute format printf to printk. Are you on a 64 bit system but printing pointers as 32 bit values?
User avatar
b.zaar
Member
Member
Posts: 294
Joined: Wed May 21, 2008 4:33 am
Location: Mars MTC +6:00
Contact:

Re: When your OS goes crazy - Screenshots

Post by b.zaar »

Synon wrote:This bug:

I don't know how it's physically possible. How can list->elements be NULL when ptr is not? They are the same type, and there's no way any code is executing in between because interrupts are disabled and the interrupt/exception handler prints a message when it executes.

I'm so confused.
Is list initialized properly? not pointing to ROM?
"God! Not Unix" - Richard Stallman

Website: venom Dev
OS project: venom OS
Hexadecimal Editor: hexed
User avatar
AndrewAPrice
Member
Member
Posts: 2300
Joined: Mon Jun 05, 2006 11:00 pm
Location: USA (and Australia)

Re: When your OS goes crazy - Screenshots

Post by AndrewAPrice »

sortie wrote:Your printf is likely wrong.
My print function used to print numbers in reverse. I only printed single digit numbers and other palindromes, so I never noticed it for a while until one day I was printing addresses and noticed they were all over the place.

Now I print into an array on the stack, the print the array backwards.
My OS is Perception.
Kevin
Member
Member
Posts: 1071
Joined: Sun Feb 01, 2009 6:11 am
Location: Germany
Contact:

Re: When your OS goes crazy - Screenshots

Post by Kevin »

sortie wrote:Your printf is likely wrong. Your varargs passing might also be. If you make two nice fake pointers yourself, can you print them? Add attribute format printf to printk. Are you on a 64 bit system but printing pointers as 32 bit values?
That was my first thought, too. You could also try printing them with gdb.

Another option is that list points to some ROM that you didn't properly mark as reserved during initialisation. I've had something like this before and it was really confusing.
Developer of tyndur - community OS of Lowlevel (German)
User avatar
iocoder
Member
Member
Posts: 208
Joined: Sun Oct 18, 2009 5:47 pm
Libera.chat IRC: iocoder
Location: Alexandria, Egypt | Ottawa, Canada
Contact:

Re: When your OS goes crazy - Screenshots

Post by iocoder »

I was trying to test my new VGA driver, so I wrote a program to draw Mandelbrot set... then happened what happened...

Image
User avatar
max
Member
Member
Posts: 616
Joined: Mon Mar 05, 2012 11:23 am
Libera.chat IRC: maxdev
Location: Germany
Contact:

Re: When your OS goes crazy - Screenshots

Post by max »

iocoder wrote:I was trying to test my new VGA driver, so I wrote a program to draw Mandelbrot set... then happened what happened... [...]
Looks quite amazing, you should add animation and keep that as the wallpaper. :mrgreen:
Synon
Member
Member
Posts: 169
Joined: Sun Sep 06, 2009 3:54 am
Location: Brighton, United Kingdom

Re: When your OS goes crazy - Screenshots

Post by Synon »

I don't have the source code or a suitable toolchain on my laptop but I can read the code on GitHub. b.zaar's question prompted me to take a look where the list is actually being allocated. The heap's blocklist is placement-allocated at 0xC0000000 (I'm following James M's tutorial on-and-off and that's where he placed his, so I did the same). Ofc at such an early stage my pages are only identity mapped and my emulator doesn't have 3 GiB RAM, so 0xC0000000 doesn't exist. I've also made the mistake of initialising my heap allocator before the page allocator, and the page allocator's initialisation function is what sets the page fault interrupt handler, hence why no error was being reported (when there's no specific interrupt handler set for an exception, the general handler just ignores it. Another thing to change). So, three things to fix. Sorry for wasting anybody's time.
User avatar
sortie
Member
Member
Posts: 931
Joined: Wed Mar 21, 2012 3:01 pm
Libera.chat IRC: sortie

Re: When your OS goes crazy - Screenshots

Post by sortie »

My new chmod(1) turned out to be a bit buggy:
Image
mallard
Member
Member
Posts: 280
Joined: Tue May 13, 2014 3:02 am
Location: Private, UK

Re: When your OS goes crazy - Screenshots

Post by mallard »

Got this while working on mouse support in my terminal driver... It's caused by mouse input being in the buffer before the terminal driver loads. I've not fully investigated it yet, but it's probably the code that copies the contents of the screen into the back-buffer being confused by the movement of the mouse cursor.
Attachments
mouse-screen-corruption.png
mouse-screen-corruption.png (10.58 KiB) Viewed 7938 times
Image
User avatar
BrightLight
Member
Member
Posts: 901
Joined: Sat Dec 27, 2014 9:11 am
Location: Maadi, Cairo, Egypt
Contact:

Re: When your OS goes crazy - Screenshots

Post by BrightLight »

You've all got crazy OSes !! :D :lol:
Last edited by BrightLight on Sat Jan 10, 2015 1:18 pm, edited 1 time in total.
You know your OS is advanced when you stop using the Intel programming guide as a reference.
User avatar
BrightLight
Member
Member
Posts: 901
Joined: Sat Dec 27, 2014 9:11 am
Location: Maadi, Cairo, Egypt
Contact:

Re: When your OS goes crazy - Screenshots

Post by BrightLight »

Testing my ZeroOS desktop,, I tried to display a letter A in VESA mode 640x480x256 (top left corner) and all works ,except the top of the letter is distorted :lol: :!:
I don't know how this happened, but I'm working on printing characters in VESA mode right now!
Attachments
ZeroOS desktop test
ZeroOS desktop test
You know your OS is advanced when you stop using the Intel programming guide as a reference.
User avatar
sortie
Member
Member
Posts: 931
Joined: Wed Mar 21, 2012 3:01 pm
Libera.chat IRC: sortie

Re: When your OS goes crazy - Screenshots

Post by sortie »

My harddisk driver broke when rewriting it:
Image
Post Reply