Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
136 user(s) are online (124 user(s) are browsing Forums)

Members: 1
Guests: 135

Mr_byte, more...

Support us!

Headlines

 
  Register To Post  

Serial device problems (68k assembler)
Just can't stay away
Just can't stay away


See User information
I'm trying to open the serial device from the Napalm net driver. Sometimes it works, but some other times it hangs the entire machine right at the call to OpenDevice(). I'm wondering why this is. Here is my garbled code:

MOVEA.L    ABSEXECBASE.W,A6    ;080: 2c780004
    LEA    dos_name
+1,A1        ;084: 43f90000033f
    MOVEQ    
#0,D0            ;08a: 7000
    
JSR    _LVOOpenLibrary(A6)        ;08c4eaefe68
    MOVE
.L    D0,dos_base        ;090: 23c000000318
    BEQ fail1

    JSR debug_puts1

    MOVEA
.L ABSEXECBASE.W,A6
    JSR _LVOCreateMsgPort
(A6)
    
MOVE.L    D0,msg_port
    BEQ    fail2

    JSR debug_puts2

    MOVEA
.L    D0,A0
    MOVE
.#IOEXTSER_SIZE,D0
    
JSR _LVOCreateIORequest(A6)
    
MOVE.L    D0,io_request
    BEQ fail3

    JSR debug_puts3
    
    LEA    serial_name
,A0
    MOVEQ    
#0,D0
    
MOVEA.L    io_request,A1
    MOVEQ    
#0,D1
    
JSR _LVOOpenDevice(A6)
    
TST    D0
    BNE    fail4

    JSR debug_puts4

Go to top
Re: Serial device problems (68k assembler)
Not too shy to talk
Not too shy to talk


See User information
I can not see any errors, other than the posibility that your debug functions trashes the D0 Register.

“The best thing about a boolean is even if you are wrong, you are only off by a bit.”
Go to top
Re: Serial device problems (68k assembler)
Just can't stay away
Just can't stay away


See User information
I have tried to remove all debug output, so that is not the problem.

And even if I try copying the code to a separate small project that just opens and closes the serial device, then there is no problem. The problem arises only when this very same code is run as part of the network driver in Napalm... Annoying!!

Who's the expert on serial device issues??

Go to top
Re: Serial device problems (68k assembler)
Just can't stay away
Just can't stay away


See User information
Arrrgh!!!...

Go to top
Re: Serial device problems (68k assembler)
Just can't stay away
Just can't stay away


See User information
Quote:
alfkil wrote:
Arrrgh!!!...
Maybe you should try the Hyperion forum, developer section?

Best regards,

Niels

Go to top
Re: Serial device problems (68k assembler)
Just can't stay away
Just can't stay away


See User information
@niels

Thanks Niels, I will do that .

Go to top
Re: Serial device problems (68k assembler)
Not too shy to talk
Not too shy to talk


See User information
Checking out you source again I found this...

acording to my old Autodoc it do not mention that the CreateMsgPort() returns the result in D0. Small chance this is wrong.

and you OpenDevice() ends with a TST D0, here you do not set the size it uses... if I remember correct ASM-Pro uses .w as default, this is wrong as the result is only a Byte size.. but that depends on the assembler you uses.

René

“The best thing about a boolean is even if you are wrong, you are only off by a bit.”
Go to top
Re: Serial device problems (68k assembler)
Just can't stay away
Just can't stay away


See User information
@rwo

Quote:

acording to my old Autodoc it do not mention that the CreateMsgPort() returns the result in D0. Small chance this is wrong.


Result should always be in D0 if function has one, except for a few functions in utility.library that return a 64-bit result in which case it's in D0/D1.

Go to top
Re: Serial device problems (68k assembler)
Just can't stay away
Just can't stay away


See User information
@rwo

I am using phxass.

It seems, that if I put crimsoncrisis on the Petunia blacklist (SYS:Prefs/Compatibility), then the problem does not arise. How could this be??

Go to top
Re: Serial device problems (68k assembler)
Not too shy to talk
Not too shy to talk


See User information
@alfkil

OpenDevice() puts the result in D0 but only as a byte (move.b d0)..

So you should really change your 'TST D0' to 'TST.B D0'.. for I expect phxass converts your 'TST D0' into 'TST.W D0' so it check to many bits..

As the 24 upper bits in D0 is trash from anywhere, and blacklisting it will only result it being run from a diffrent place and will ofcoase result in diffrent upper 24bits.

But if this change do not work I must say I don't have an idea whats is wrong.

Btw: what serial device do you open?

EDIT: Windows locked up, so I had to make a temp save


Edited by rwo on 2011/12/2 16:13:48
“The best thing about a boolean is even if you are wrong, you are only off by a bit.”
Go to top
Re: Serial device problems (68k assembler)
Just can't stay away
Just can't stay away


See User information
@rwo

I have tried to change TST to TST.B, and so far it has not hung up on me! Thanks for noticing this (if this is really the solution)!

Go to top

  Register To Post

 




Currently Active Users Viewing This Thread: 1 ( 0 members and 1 Anonymous Users )




Powered by XOOPS 2.0 © 2001-2024 The XOOPS Project