Re: [uCsimm] date and getbenv()

From: David Beckemeyer (david@corp.earthlink.net)
Date: Sun Jan 23 2000 - 20:47:53 EST


On Wed, Nov 17, 1999 at 09:57:47PM +0900, Dai Katoh wrote:

> 2) Is "getbenv()" provided?
> "uCsimm/uC68EZ328 Hardware Software Manual" shows that getbenv() is provided
> as Bootloader API , but I coudn't use and find it in any header files.
> Where....?

In various directories in the uClinux tree you'll find a header
file called "bootstd.h" of which there appear to be several
variants.

They define a number of calls, but getbenv isn't among them. They
map to numeric arguments, so I simply took a guess that the calls
were in the order given in the manual and added a defition for
getbenv() in my own bootstd.h and it worked! In my copy of bootstd.h
I added the new arg (diff below) then in my app I put the following
to define the function:

_bsc1(char *,getbenv,char *,a)

Has anoyone tried this for the rest of the Bootloader API calls, or
can RT-Control or anyone supply a proper bootstd.h for the rest of
the missing calls (i.e. setbenv, setpmask, readenv,
flash_chattr_range, flash_erase_range, flash_write_range)?

My trivial diffs to bootstd.h for getbenv() follow:

*** bootstd.h.orig Tue Sep 14 00:08:33 1999
--- bootstd.h Wed Jan 5 21:13:56 2000
***************
*** 6,12 ****
  #ifndef __BOOTSTD_H__
  #define __BOOTSTD_H__
  
! #define NR_BSC 14 /* last used bootloader system call */
  
  #define __BN_reset 0 /* reset and start the bootloader */
  #define __BN_test 1 /* tests the system call interface */
--- 6,12 ----
  #ifndef __BOOTSTD_H__
  #define __BOOTSTD_H__
  
! #define NR_BSC 15 /* last used bootloader system call */
  
  #define __BN_reset 0 /* reset and start the bootloader */
  #define __BN_test 1 /* tests the system call interface */
***************
*** 22,27 ****
--- 22,28 ----
  #define __BN_munmap 11 /* remove a file to memory mapping */
  #define __BN_gethwaddr 12 /* get the hardware address of my interfaces */
  #define __BN_getserialnum 13 /* get the serial number of this board */
+ #define __BN_getbenv 14 /* get bootloader environment variable */
  
  /* Calling conventions compatible to (uC)linux/68k
   * We use simmilar macros to call into the bootloader as for uClinux
This message resent by the ucsimm@uclinux.com list server http://www.uClinux.com/



This archive was generated by hypermail 2b30 : Sun Apr 07 2002 - 00:01:34 EST