So I'm currently trying to implement a screenshotting feature for my operating system, however for some reason, every bmp screenshot comes out in a way where the taskbar and the watermark on the desktop get screenshotted fine, but then it proceeds to repeat a segment of the image over and over from the bottom to the top, until that segment fills up the rest of the image.
I'll attach screenshots if needed.
Screenshot feature repeats pattern
-
Octocontrabass
- Member

- Posts: 6249
- Joined: Mon Mar 25, 2013 7:01 pm
Re: Screenshot feature repeats pattern
Is this a problem with reading from the framebuffer, writing to the disk, or something that happens between such as allocating memory?
Also this question has nothing to do with the wiki so I've moved it somewhere more appropriate.
Also this question has nothing to do with the wiki so I've moved it somewhere more appropriate.
-
ihateassembly
- Posts: 5
- Joined: Sun Mar 15, 2026 2:37 pm
Re: Screenshot feature repeats pattern
I'm suspecting that it might be an MMIO issue. It's also weird how it just loops a certain part of the screenshot instead of it being corrupted. I tried doing it from top to bottom too, but it just flipped the image and the effect too, so it went from top to bottom
-
Octocontrabass
- Member

- Posts: 6249
- Joined: Mon Mar 25, 2013 7:01 pm
Re: Screenshot feature repeats pattern
Given that the corruption perfectly lines up with 63-sector boundaries I'd say the problem is most likely related to writing the file to the disk.
Have you tried writing any other files of this size to the disk? Are those files also corrupted?
Have you tried writing any other files of this size to the disk? Are those files also corrupted?
-
ihateassembly
- Posts: 5
- Joined: Sun Mar 15, 2026 2:37 pm
Re: Screenshot feature repeats pattern
Not yet. Also how do I figure out if an issue like this perfectly aligns with any sector boundaries for next time this happens?
-
Octocontrabass
- Member

- Posts: 6249
- Joined: Mon Mar 25, 2013 7:01 pm
Re: Screenshot feature repeats pattern
I figured it out by looking at the corrupted file in a hex editor. The addresses where the data repeats all divide evenly by 0x7E00, which happens to also be the number of bytes in 63 sectors.
-
ihateassembly
- Posts: 5
- Joined: Sun Mar 15, 2026 2:37 pm
Re: Screenshot feature repeats pattern
Yeah, it was breaking it into 63 sector chunks, and something in the disk handling was writing over values in registers, I've made it so that it stores the stack pointer in a dedicated memory location. Now just onto merging the screenshot capture and write into one function.Octocontrabass wrote: ↑Tue Mar 17, 2026 2:45 pm I figured it out by looking at the corrupted file in a hex editor. The addresses where the data repeats all divide evenly by 0x7E00, which happens to also be the number of bytes in 63 sectors.