Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
45 user(s) are online (32 user(s) are browsing Forums)

Members: 4
Guests: 41

Raziel, trixie, Thematic, Rob, more...

Support us!

Headlines






Serial device problems (68k assembler)
Just can't stay away
Joined:
2009/10/7 1:11
From Copenhagen
Posts: 1205
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    ;0802c780004
    LEA    dos_name
+1,A1        ;08443f90000033f
    MOVEQ    
#0,D0            ;08a: 7000
    
JSR    _LVOOpenLibrary(A6)        ;08c4eaefe68
    MOVE
.L    D0,dos_base        ;09023c000000318
    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

   Report Go to top

Re: Serial device problems (68k assembler)
Not too shy to talk
Joined:
2006/12/1 23:50
From Skærbæk. Denmark
Posts: 266
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.”
   Report Go to top

Re: Serial device problems (68k assembler)
Just can't stay away
Joined:
2009/10/7 1:11
From Copenhagen
Posts: 1205
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??

   Report Go to top

Re: Serial device problems (68k assembler)
Just can't stay away
Joined:
2009/10/7 1:11
From Copenhagen
Posts: 1205
Arrrgh!!!...

   Report Go to top

Re: Serial device problems (68k assembler)
Just can't stay away
Joined:
2006/12/1 18:01
From Copenhagen, Denmark
Posts: 1244
Quote:
alfkil wrote:
Arrrgh!!!...
Maybe you should try the Hyperion forum, developer section?

Best regards,

Niels

   Report Go to top

Re: Serial device problems (68k assembler)
Just can't stay away
Joined:
2009/10/7 1:11
From Copenhagen
Posts: 1205
@niels

Thanks Niels, I will do that .

   Report Go to top

Re: Serial device problems (68k assembler)
Not too shy to talk
Joined:
2006/12/1 23:50
From Skærbæk. Denmark
Posts: 266
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.”
   Report Go to top

Re: Serial device problems (68k assembler)
Just can't stay away
Joined:
2006/11/30 11:30
From Finland
Posts: 1801
@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.

   Report Go to top

Re: Serial device problems (68k assembler)
Just can't stay away
Joined:
2009/10/7 1:11
From Copenhagen
Posts: 1205
@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??

   Report Go to top

Re: Serial device problems (68k assembler)
Not too shy to talk
Joined:
2006/12/1 23:50
From Skærbæk. Denmark
Posts: 266
@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.”
   Report Go to top

Re: Serial device problems (68k assembler)
Just can't stay away
Joined:
2009/10/7 1:11
From Copenhagen
Posts: 1205
@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)!

   Report Go to top





[Advanced Search]



Powered by XOOPS 2.0 © 2001-2016 The XOOPS Project