![]() |
RTEMS 6.3
|
Directories | |
| ata | |
| btimer | |
| clock | |
| console | |
| include | |
| start | |
This board support package works with a target PC
This BSP supports a standard Intel/AMD PC on i386 and up CPUs. If on a Pentium or above, the TSC register is used for timing calibration purposes rather than relying entirely on the i8254.
Partial support is implemented for more modern PCs which do not have a complete complement of legacy peripherals.
The pc386 console device driver supports a variety of devices including the VGA/keyboard and a number of serial ports. The default console is selected based on which devices are present in the following order of priority:
Beyond the dynamic probing for device presence, a combination of configure and boot time options are available. By default, all devices are enabled. The configure time options are:
An example of using these to force the console to COM1 is:
The –console and –printk options can be used to specify the device associated with stdin, stdout, and stderr as well as the device associated with kernel debug IO (e.g. printk()/getk()). Both take the name of a device without the "/dev/" prefix.
The –console argument is interpreted first and assumed to specify the console and kernel debug IO device. The –printk is then interpreted to specify the debug kernel IO device. For example,
specifies that com1 is to be used for stdin, stdout, and stderr while the VGA console is to be used for kernel debug IO. Note that the lower case com1 is intentional as this maps to the RTEMS device /dev/com1.
The device name may be followed by a baud rate. The following example illustrates this:
If the specified device is not present, then a suitable fallback device is selected. The fallback order is based upon the probe order listed earlier.
PCI UART devices are /dev/pcicom1 etc as they are probed and found.
GDB can be support using:
The GDB stub details and in shared/comm/GDB.HOWTO.
The following files were developed by Erich Boleyn erich.nosp@m.@uru.nosp@m.k.org. The original files were copied from http://www.uruk.org/mps/ and committed into cvs as is. These files will be modified for RTEMS smp support, but the original files are being committed in order to track any file changes that occur. We are attempting to keep these changes as minimal and conainted as possible.
There are a wide range of PC configurations. This BSP has been tested on only a handful. There are configurations which do not yet work. The failure is suspected to be video card related. Here is a list of successes and failures.
The dec21140 network driver is found in libchip/networking.
+--------------------------------------------------------------------------—+ | RTEMS 4.6.0 PC386 BSP HOWTO - 2003/05/08 | | | +--------------------------------------------------------------------------—+ | (C) Copyright 1998 - |
| - NavIST Group - Real-Time Distributed Systems and Industrial Automation |
|---|
| http://pandora.ist.utl.pt |
| Instituto Superior Tecnico * Lisboa * PORTUGAL |
+--------------------------------------------------------------------------—+
| Disclaimer: |
|---|
| This file is provided "AS IS" without warranty of any kind, either |
| expressed or implied. |
+--------------------------------------------------------------------------—+ | History: | | 12 June 2000 - Updated to 4.5 (Joel) | | 8 May 2003 - PXE GRUB (Chris Johns) | +--------------------------------------------------------------------------—+
This tries to explain how to setup the RTEMS host environment so that RTEMS applications can be built for and run in a bare PC 386 or above.
It covers essentially the aspects of loading images, since information concerning other issues such as building the development tools and the RTEMS distribution can be found in the 'RTEMS 4.6.0 On-Line Library' under 'Getting Started with RTEMS for C/C++ Users'.
Please note that everything in the following text using the notation '<...>' is just an alias to something and should always be substituted by the real thing!
Obtaining, building and installing the tools for building the PC386 BSP of RTEMS is covered in detail in the 'RTEMS 4.6.0 On-Line Library' -> 'Getting Started with RTEMS for C/C++ Users'. You can either use pre-built toolset executables or build your own from the instructions given there.
This BSP is designed to work only with ELF toolset configurations. This is format used by the i386-rtems target.
Obtaining, building and installing the tools for building the PC386 BSP is covered in detail in the 'RTEMS 4.6.0 On-Line Library' -> 'Getting Started with RTEMS for C/C++ Users' -> 'Building RTEMS'.
When running configure, use the following values for the listed options with an i386-rtems toolset:
If you've completed the last step successfully, you'll find the RTEMS sample and test files that can be loaded with GRUB in the '<build_point>/pc386/tests' directory, RTEMS sample and test files in a format suitable for use with NetBoot in the '<build_point>/pc386/BootImgs' directory.
Files which have been "tarred, gzipped" (i.e. .tar.gz or .tgz
extension) may be unarchived with a command similar to one of the following:
OR
OR
NOTE: gunzip -c is equivalent to zcat. On commercial (non-Linux) Unices, since the GNU utilities are not the standard 'tar' will be gtar (GNU tar) and 'zcat' will be 'gzcat'.
Given that the necessary utility programs are installed, any of
the above commands will extract the contents of <file>.tar.gz into the current directory. To view the contents of an archive without restoring any files, use a command similar to the following:
Using GRUB (GRand Unified Bootloader) is the simplest way to load
and run your PC386 BSP samples, tests and programs. You will need to build GRUB so you need a working GCC and friends. The online documentation for GRUB lists what you need:
- http://www.gnu.org/manual/grub/html_node/index.html You can get the latest release of GRUB from its homepage: - http://www.gnu.org/software/grub/ Once you obtain the .tar.gz archive from: - ftp://alpha.gnu.org/gnu/grub/
Download the lastest version (grub-0.93.tar.gz), change to a temporary directory (you won't need the grub files after this and can just go ahead and delete the whole directory structure that was generated) and unarchive 'grub-0.93.tar.gz' following the instructions given above in [2. Unarchiving].
after this is done create a build directory and decend into it:
shell $ ../grub-0.93/configure
shell $ make
shell dd if=stage1/stage1 of=/dev/fd0 bs=512 count=1 dd if=stage2/stage2 of=/dev/fd0 bs=512 seek=1
shell copy /b stage1\stage1 stage2\stage2 grub.raw
shell install=(fd0)/stage1 (fd0) (fd0)/stage2 0x8000 (fd0)/grubmenu
shell $ ../grub-0.93/configure –enable-diskless –enable-eepro100
shell $ make
shell #
#
group { filename "/tftpboot/pxeboot"; host rtems-pc { hardware ethernet 00:08:c7:73:41:65; } }
shell GRUB version 0.93 (639K lower / 64512K upper memory)
Address: 10.10.10.10 NetMask: 255.255.255.0 Server: 10.10.10.1 Gateway: 10.10.10.1
[ Minimal BASH-like line editing is supported. For the first word, TAB lists possible command completions. Anywhere else TAB lists the possible completions of a device/filename. ]
grub>
shell grub> root (nd) Filesystem type is tftp, using whole disk
grub> kernel ticker.exe [Multiboot-elf, <0x100000:0x1e5a4:0x2b08>, shtab=0x122140, entry=0x10000c]
grub> boot
shell ./configure –disable-mknbi-dos –disable-mknbi-linux –disable-mknbi-mgl ```
Afterwards, you should follow the instructions contained in the
'INSTALL' file also contained in the base directory, on how to setup the server(s) and to build a boot ROM for the client PC network card, or a boot diskette, and the PC client should be able to load the '*.bt' files from the server.
The important sections to check in the 'INSTALL FILE' are the last two: - Setup of the server (only the BOOTP and TFTP parts - ignore NFS). =================== - Setup of the client including building the bootrom ==================================================
all the rest can be safely ignored if you don't care to examine it.
NOTE: All the following paths are relative to the base directory of the RTEMS distribution.
As of the writing of this HOWTO, PC386 images can be loaded either in low memory 0x10000 (64KB) until 0x97C00 (607K) using NetBoot or in high memory from 0x100000 (1024KB) until the top of the available memory using either NetBoot or GRUB.
If you want to change the default loading address from 1024KB to something else, just change the value of the variable RELOCADDR in the 'make/custom/pc386.cfg' file to the new value you want (make sure you follow the instructions indicated before the definition of RELOCADDR).
Remember that GRUB restricts the loading addresses to values above 0x100000 (1024KB), only NetBoot can load images in low memory.
After you make any changes to RELOCADDR and if you are using NetLoader, you'll have to recompile the 'c/src/lib/libbsp/i386/pc386/start/start16.s' file. The easiest way to achieve this is just to 'make clean' and the 'make all' again. The quickest way is to change to '<build_point>/c/src/lib/libbsp/i386/pc386/start' and 'make RTEMS_BSP=pc386 clean all'.
When programming interrupt handlers take into account that the PIC is reprogrammed and so you should use the interface functions provided in '<build_point>/pc386/lib/include/irq.h> to guarantee that everything works ok.