hi,
after finding help in many places I decieded to write here.
http://cage2.republika.pl/pmode_18.tar
That's my code in nasm, it boots up from floppy, it has macros to draw points, lines, rectangulars, all in 32 bit pmode. All in 13h mode 320x200 set in 16 bit real mode, before seting pmode. To emulate x86 machine I use bochs 2.2, cvs from 28 may 2005. My specs are Athlon 2000+ 256MB@266, ascrock k7vt4a pro, MSI GeForce 3 ti 200. In this archive in file MAIN.S, when I try:
line 160, 100, 200, 100, 15
line_vert 160, 60, 100, 15
line 160, 100, 140, 120, 15
line 140, 120, 180, 120, 15
It is OK, run in bochs, does not run in real world (something wrong with my pc, because on other pc on which I tested it yesterday it works very well),
but when I add:
line 160, 100, 200, 100, 15
line_vert 160, 60, 100, 15
line 160, 100, 140, 120, 15
line 140, 120, 180, 120, 15
line 160, 100, 120, 60, 14
this... I get this:
00001695024i[CPU ] BxError: instruction with op1=0xff
00001695024i[CPU ] mod was c0, nnn was 7, rm was 7
00001695024i[CPU ] WARNING: Encountered an unknown instruction (signalling illegal instruction)
00001695024e[CPU ] exception(): 3rd (13) exception with no resolution, shutdown status is 00h, resetting
And it doesn't work both in bochs in real world.
video
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:video
well, that seems to be a jump to something that is not an instruction. Quite weird, heh ?
I'd recommend you run bochs in debug mode with trace-on enabled to see what instruction cause that jump.
hint: could you by any chance be using some computation on signs of (x1-x2) and (y1-y2) to branch to a specific line-drawing function ? it looks like the line you've added is the only one to be backward in both X and Y axis ...
I'd recommend you run bochs in debug mode with trace-on enabled to see what instruction cause that jump.
hint: could you by any chance be using some computation on signs of (x1-x2) and (y1-y2) to branch to a specific line-drawing function ? it looks like the line you've added is the only one to be backward in both X and Y axis ...
Re:video
About this signs, that would be right way, only if I it would be not done before. It cause some problems, at the begining, when line macro was not working at all properly. But now I've done to this point when I use any direction it works, but it is all about, that when I give to draw more objects, such as two rectangulars, in this case one more line.
About bochs in debug mode. I compiled bochs with:
./configure --enable-debugger --enable-disasm
Then I get bochs prompt, and I was wondering how to exit this debugging mode and execute my code normally. I didn't find anything how to do it.
Maybe here is something but I cannot see it:
http://bochs.sourceforge.net/doc/docboo ... ugger.html
About bochs in debug mode. I compiled bochs with:
./configure --enable-debugger --enable-disasm
Then I get bochs prompt, and I was wondering how to exit this debugging mode and execute my code normally. I didn't find anything how to do it.
Maybe here is something but I cannot see it:
http://bochs.sourceforge.net/doc/docboo ... ugger.html
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:video
the usual debug session with bochs for the osdever looks like
If you're using GRUB with a kernel loaded at 1MB, you might prefer
assuming your _kinit or _start or whatever entry symbol is at 0x1234 within your kernel.
Code: Select all
pbreak 0x7c00 ; break at the bootsector
c ; let the debugger 'C'ontinue 'til then
trace-on ; get a list of every executed instruction
c ; now run your kernel
Code: Select all
pbreak 0x101234
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:video
it should be forwarded in the logfile too ... or just use common redirection techniques:
hmm, if you're under windows, probably the logfile is your only help.bochs-debug | tee trace-file