Page 2 of 2

Re: Patricknet Might end- i need help ERGENT

Posted: Sun Sep 14, 2008 8:44 pm
by PatrickV
bad news

Code: Select all

xor ax,ax
mov ds,ax
mov es,ax
still have my floppy disk problem

Re: Patricknet Might end- i need help ERGENT

Posted: Sun Sep 14, 2008 8:46 pm
by cr2
Post the code you're testing. I'll try it out on bochs and see if your problem exists there. :wink:

Re: Patricknet Might end- i need help ERGENT

Posted: Sun Sep 14, 2008 8:52 pm
by PatrickV
here you go the code

Code: Select all

[bits 16]
[org 0x7c00]
jmp Start
; Message Strap
msg		db "Patricknet - Version: Beta 0.2 (15/9/2008)",13,10,0
Start:
	xor ax,ax
	mov dx,ax
	mov es,ax
		
	mov si,msg               
	call pd

pd:     
	mov ah,0x0E
	mov bh,0x00
	mov bx,0x07
	pdc:
		lodsb
		or al,al
		jz short pdend
		int 0x10
		jmp pdc
pdend:    
	retn		; return to caller

padding     TIMEs 510-($-$$) db 0
;Flag Point Form Bios To Notice That This A Patricknet Boot Sector Is Vaild By Signature
Dw 0AA55h

I also uploaded a file of boot.asm

Re: Patricknet Might end- i need help ERGENT

Posted: Sun Sep 14, 2008 8:59 pm
by cr2
I'd get a new test computer if I were you. :cry:

Well, it did work on bochs! \:D/ =D> :D :) :lol: :wink: :twisted:

Re: Patricknet Might end- i need help ERGENT

Posted: Sun Sep 14, 2008 9:01 pm
by Brendan
Hi,

Um.... What is meant to happen after the "call pd" instruction?

At the moment, it'll return from the "pd" routine just after the "call pd" instruction and keep executing. This means it'll execute the "pd" routine a second time (because that's what comes after the "call pd" instruction), and SI will be pointing to the byte after the "msg" string so it'll display your code as ASCII until it finds a second zero byte. When it does find that second zero byte the "pd" routine will try to return, but it wasn't actually called so there's no return address on the stack. At this point it might crash, lockup or do anything else.

You might want to insert something like this after the "call pd" instruction:

Code: Select all

.die:  hlt
         jmp .die
It'd also be good to setup a stack (instead of assuming the stack the BIOS left behind is sane):

Code: Select all

    xor ax,ax
    cli
    mov ss,ax
    mov sp,0x7C00
    sti

Cheers,

Brendan

Re: Patricknet Might end- i need help ERGENT

Posted: Sun Sep 14, 2008 9:03 pm
by PatrickV
Thanks. I use 3 computers to make it 1 is write and compile 1 used to write to floppy because my main computer doesn't have a floppy disk drive and the other to test it. By the way could it be that it only work emulated not on real hardware? that could be a possible. Plus how could i see it for my self on bochs?

Re: Patricknet Might end- i need help ERGENT

Posted: Sun Sep 14, 2008 9:17 pm
by cr2
using bochs 2.0(the version I use)...

Make a new file. Lets just say you saved it as "C:\etc\script.txt". Put this in the file:

Code: Select all

romimage:    file=BIOS-bochs-latest, address=0xf0000 
vgaromimage: VGABIOS-lgpl-latest 
floppya: 1_44=a:, status=inserted 
log:         bochs_log.log
error:       action=report 
info:        action=report
megs: 32
NOTE: you WILL need to add to this when your OS progresses.

now, using the command line, do this:

Code: Select all

bochs -f C:\etc\script.txt -q
...and it should work!

Re: Patricknet Might end- i need help ERGENT

Posted: Sun Sep 14, 2008 9:21 pm
by PatrickV
where does the disk image come into can you give me a copy that you used. I mean they floppy disk image and how will you add that into the script

Re: Patricknet Might end- i need help ERGENT

Posted: Sun Sep 14, 2008 9:45 pm
by cr2
well...

if you put the floppy disk with Patricknet it into the computer with bochs on it, the script should work just like that (and run Patricknet, for that matter). :wink:

Re: Patricknet Might end- i need help ERGENT

Posted: Sun Sep 14, 2008 10:00 pm
by PatrickV
can you please give the link of the program just incase if want to do it from a with floppy image so other people can use it so i don't have to swap machines.

Re: Patricknet Might end- i need help ERGENT

Posted: Sun Sep 14, 2008 10:10 pm
by PatrickV
plus nothing shows in bochs when i have the floppy disk

Re: Patricknet Might end- i need help ERGENT

Posted: Sun Sep 14, 2008 10:37 pm
by cr2
This might be a better bochs tutorial than my own. Use it instead.