Subject:
|
Re: legOS ... really a stack question
|
Newsgroups:
|
lugnet.robotics
|
Date:
|
Sun, 3 Jan 1999 00:49:42 GMT
|
Original-From:
|
John A. Tamplin <jat@=antispam=Traveller.COM>
|
Viewed:
|
1399 times
|
| |
| |
On Sat, 2 Jan 1999, Rick Kimball wrote:
> I'm still having reliability problems with legOS when
> using the task management routines. However, I think
> the problem has more to do with the stack than the
> tm routines. I think the problem is related to the
> direct-motor routines and the entries in h8300.rcx file.
>
> I noticed that when I have more than a couple of
> tasks and one of them uses the direct-motor fuctions
> the program flakes out. Looking at the direct-motor.c
> I noticed that it uses the following asm instruction:
>
> mov.b r6l, @0xf0000:16
>
> I'm not an assembler language programmer, so correct me
> if I'm wrong. I'm assuming that this moves one byte from
> the low word of register 6 into address location 0xf000.
Correct, that is where the motor driver chips live. It isn't actually RAM.
> Then I noticed that in the h8300.rcx file the stack
> starts at 0xfefc. I'm assuming this is the top of
> the stack and that it should grow downward towards the
> heap which ends at 0xcc00. Let's just ignore the stack
> and the heap colliding for now.
The _stack symbol defined by the linker is normally used by crt0 to set the
initial stack pointer. In this case, the stack pointer isn't changed by
legOS initially, so it is running on the stack supplied by the ROM. Later,
it changes the stack to dynamically allocated space.
> If both of my assumptions above are correct won't the
> direct-motor routines stomp the stack.
>
> I changed the topram entry in my h8300.rcx to be 0xef00 instead
> of 0xfefc. This made the program run without any problems.
> Was I just lucky or are my assumptions correct?
I think you were just lucky since the _stack symbol isn't used anywhere
in the code (that I am aware of).
John A. Tamplin Traveller Information Services
jat@Traveller.COM 2104 West Ferry Way
256/705-7007 - FAX 256/705-7100 Huntsville, AL 35801
--
Did you check the web site first?: http://www.crynwr.com/lego-robotics
|
|
Message is in Reply To:
| | legOS ... really a stack question
|
| I'm still having reliability problems with legOS when using the task management routines. However, I think the problem has more to do with the stack than the tm routines. I think the problem is related to the direct-motor routines and the entries in (...) (26 years ago, 2-Jan-99, to lugnet.robotics)
|
10 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
Active threads in Robotics
|
|
|
|