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.
Instead of printing 'X' it prints ' '(blank space/ deletes character that's already there)
Maybe because you're passing an string instead of a character... (change char* message to char message, and instead of "X" use 'X') I don't know, we don't have enough info.
Instead of printing 'X' it prints ' '(blank space/ deletes character that's already there)
Maybe because you're passing an string instead of a character... (change char* message to char message, and instead of "X" use 'X') I don't know, we don't have enough info.
iansjack wrote:I'd offer you the same advice as before, but you'd only ignore it so there's no point.
You're not showing us enough of your code for a sensible answer - link to your repository.
Sir I didn't ignore your last message. I didn't debug right now because I couldn't get the gdb and qemu working. I didn't worry about this much cause I'm soon switching to linux.
I'm a beginner to this and by your stars I know you are far more experienced than me and I know what you say is important.
Instead of printing 'X' it prints ' '(blank space/ deletes character that's already there)
Maybe because you're passing an string instead of a character... (change char* message to char message, and instead of "X" use 'X') I don't know, we don't have enough info.
iansjack wrote:I'd offer you the same advice as before, but you'd only ignore it so there's no point.
You're not showing us enough of your code for a sensible answer - link to your repository.
Sir I didn't ignore your last message. I didn't debug right now because I couldn't get the gdb and qemu working. I didn't worry about this much cause I'm soon switching to linux.
I'm a beginner to this and by your stars I know you are far more experienced than me and I know what you say is important.
You aren't use a cross compiler. If the OS you are building on is 64-bit then it is likely generating 64-bit code. GCC will need the -m32 option and LD will need the option -melf_i386 added to them to generate and link 32-bit code. This is a guess based on similar problems with video output working inconsistently as you describe are often related to 64-bit code running in 32-bit protected mode. It won't work as expected. If this is your problem then I rote a Stackoverflow answer about something similar: https://stackoverflow.com/questions/398 ... y/39815993
If building 32bit kernels I recommend using an i686 (or i386) cross compiler. OSDev Wiki has information on doing that: https://wiki.osdev.org/GCC_Cross-Compiler
I see you are using Windows. If you are using a 64-bit toolchain you might have to use -mi386pe with LD.
I won't delete this but it appears this likely isn't your problem.
I learned you were using MingGW 6.3.0 and Nullplan'ss general observation about the read only data section appears correct, except with MinGW the read only data sections are .rdata*. Try modifying your linker script to look like:
I also amended it to be *(.text*) as it is possible for GCC to create a number of .text sections that begin with .text.
It really is a symptom though that you are only reading 2 sectors in boot.asm. The default alignment with the MinGW linker is 4kb for sections that don't explicitly appear in the linker script. Your read only data happens to sit outside the sectors of the disk you did read so the memory where your string would have been was probably filled with zeros. Setting AL to 17 for int13h/ah=2 would be a start but hard coding the size is a hack.
iansjack wrote:I'd offer you the same advice as before, but you'd only ignore it so there's no point.
You're not showing us enough of your code for a sensible answer - link to your repository.
Sir I didn't ignore your last message. I didn't debug right now because I couldn't get the gdb and qemu working. I didn't worry about this much cause I'm soon switching to linux.
I'm a beginner to this and by your stars I know you are far more experienced than me and I know what you say is important.