Works fine on my comp so I'm just gonna ignore the print problem and get you to fix something else right away.
Code: Select all
[org 0x7c00]
jmp 0x0:stage1
stage1:
Now to the assembler (NASM, since you are using the times directive) the label
stage1 is simply an offset into the binary file. The
org 0x7c00 directive tells the assembler to add 0x7c00 to that offset to produce the final address associated with that label.
This behaviour menas the far jump executes fine (Note that near jumps use a relative offset, so they aren't affected by the org statement),
because you are setting cs to 0x0 in the process.
Now comes the problem.
Code: Select all
mov ax, 0x7c0
mov ds, ax
mov es, ax
mov fs, ax
mov gs, ax
You set every other segment to be 0x7c0. This means that any time you address memory you are going to be looking in the wrong place.
If, for example, I wanted to put the contents of
bootsig into memory I'd normally do something like:
With the environment you've set up this will
NOT work.
Because you are using both the org directive
AND have set the base of the segments then what that instruction actually reads as (It implicitly uses ds) is:
Code: Select all
move into ax the word at (0x7c0:0x7c00 + offset of bootsig)
Which is obviously not the correct address of
bootsig.
Either use the org directive to make the labels correct, and set the segments to 0x0, or set the segments to 0x7c0 and the org directive to 0x0. The two mechanisms are mutually exclusive.
Sorry if that sounds patronising, but I'd rather risk that than have you come back in a couple of days with this problem.
***
As for the print problem. I know this is gonna sound seriously dumb, but are you sure it isn't printing? I only say this because if I hadn't known that char was going to come out in the top left corner of the screen I would probably not have noticed the change from the BIOS splash text.