Patricknet Might end- i need help ERGENT

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.
PatrickV
Member
Member
Posts: 151
Joined: Sun Jul 06, 2008 7:50 pm
Location: New Zealand
Contact:

Re: Patricknet Might end- i need help ERGENT

Post by PatrickV »

bad news

Code: Select all

xor ax,ax
mov ds,ax
mov es,ax
still have my floppy disk problem
User avatar
cr2
Member
Member
Posts: 162
Joined: Fri Jun 27, 2008 8:05 pm
Location: ND, USA

Re: Patricknet Might end- i need help ERGENT

Post by cr2 »

Post the code you're testing. I'll try it out on bochs and see if your problem exists there. :wink:
OS-LUX V0.0
Working on...
Memory management: the Pool
PatrickV
Member
Member
Posts: 151
Joined: Sun Jul 06, 2008 7:50 pm
Location: New Zealand
Contact:

Re: Patricknet Might end- i need help ERGENT

Post 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
Attachments
BOOT.ASM
(592 Bytes) Downloaded 23 times
User avatar
cr2
Member
Member
Posts: 162
Joined: Fri Jun 27, 2008 8:05 pm
Location: ND, USA

Re: Patricknet Might end- i need help ERGENT

Post 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:
OS-LUX V0.0
Working on...
Memory management: the Pool
User avatar
Brendan
Member
Member
Posts: 8561
Joined: Sat Jan 15, 2005 12:00 am
Location: At his keyboard!
Contact:

Re: Patricknet Might end- i need help ERGENT

Post 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
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
PatrickV
Member
Member
Posts: 151
Joined: Sun Jul 06, 2008 7:50 pm
Location: New Zealand
Contact:

Re: Patricknet Might end- i need help ERGENT

Post 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?
User avatar
cr2
Member
Member
Posts: 162
Joined: Fri Jun 27, 2008 8:05 pm
Location: ND, USA

Re: Patricknet Might end- i need help ERGENT

Post 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!
OS-LUX V0.0
Working on...
Memory management: the Pool
PatrickV
Member
Member
Posts: 151
Joined: Sun Jul 06, 2008 7:50 pm
Location: New Zealand
Contact:

Re: Patricknet Might end- i need help ERGENT

Post 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
User avatar
cr2
Member
Member
Posts: 162
Joined: Fri Jun 27, 2008 8:05 pm
Location: ND, USA

Re: Patricknet Might end- i need help ERGENT

Post 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:
OS-LUX V0.0
Working on...
Memory management: the Pool
PatrickV
Member
Member
Posts: 151
Joined: Sun Jul 06, 2008 7:50 pm
Location: New Zealand
Contact:

Re: Patricknet Might end- i need help ERGENT

Post 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.
PatrickV
Member
Member
Posts: 151
Joined: Sun Jul 06, 2008 7:50 pm
Location: New Zealand
Contact:

Re: Patricknet Might end- i need help ERGENT

Post by PatrickV »

plus nothing shows in bochs when i have the floppy disk
User avatar
cr2
Member
Member
Posts: 162
Joined: Fri Jun 27, 2008 8:05 pm
Location: ND, USA

Re: Patricknet Might end- i need help ERGENT

Post by cr2 »

This might be a better bochs tutorial than my own. Use it instead.
OS-LUX V0.0
Working on...
Memory management: the Pool
Post Reply