arch/m68knommu/kernel/head.S) initializes
the on-chip RAM and copies the instructions
that initialize RAM and ROM to the onchip RAM and branches to the onchip RAM.
After finishing setting up RAM and ROM, it jumps back to the ROM(now, ROM's
starting address is changed to 0xc00000).
Memory blocks are configured as in the table.
| Address | Block |
|---|---|
| 0x000000 - 0x7fffff | RAM |
| 0xc00000 - 0xcfffff | ROM |
| 0xffe000 - 0xffefff | MBC registers (MC68EN302 specific registers) |
| 0xfff000 - 0xffffff | IMP registers (MC68302 specific registers) |
start_kernel(). All the kernel data structures are
initialized in start_kernel(), and then init
program is executed. In init(/etc/init), RAM file system
and proc file system are mounted and the loopback device and the ethernet device
are initialized, and then finally shell(/bin/sh) starts.
MEMORY
{
flash : ORIGIN = 0xc00000, LENGTH = 0x100000
ram : ORIGIN = 0x400, LENGTH = 0x800000 - 0x400
eram : ORIGIN = 0x800000, LENGTH = 1
}
SECTIONS
{
.text :
{
text_start = . ;
*(.text)
_etext = . ;
__data_rom_start = ALIGN ( 4 ) ;
} > flash
.data :
{
__data_start = . ;
*(.data)
_edata = . ;
edata = ALIGN( 0x10 ) ;
} > ram
.bss :
{
__bss_start = ALIGN( 0x10 ) ;
__data_end = ALIGN( 0x10 ) ;
*(.bss)
*(COMMON)
__bss_end = . ;
end = ALIGN( 0x10 ) ;
_end = ALIGN( 0x10 ) ;
} > ram
.eram :
{
_ramend = . ;
} > eram
}
drivers/char/68302serial.c)If the trasmission is enabled, the CP(Communication Processor) starts with the first BD in the BD tabe, periodically checking the `ready' bit. Once it is ready, it will process that BD, reading data from its buffer, doing some protocol processing and moving the resultant data to the transmit FIFO.
When data arrives from the serial line, the CP performs certain required protocol processing on the data and moves the resultant data to the buffer pointed bu the first BD. When the next data arrives, the next BD is used for storing data.
In the Hydra, only one BD is used for RX and TX each for simplicity.
The address of the RX BD is 0xfff400, and the RX buffer is 0xfff180.
And, the address of the TX BD is 0xfff440, and the TX buffer is 0xfff000.
One buffer is good enough(up to 38400bps), and we've never had any problem yet.
But, if we need really fast serial port, then we may need to use several
BDs for the reception and transmission.
| SCON1 | It controls SCC1's operation and selects clock source and baud rate. The device driver supports 9600, 19200, and 38400 bps. The value of SCON1 register is set to 0x0102 for 9600 bps, 0x0080 for 19200 bps, and 0x0040 for 38400 bps. |
|---|---|
| SCM1 | It's a mode register. Diagnostic mode is set to software operation where CTS, CD lines are under software control, and the receiver and the transmitter are enabled, and the channel mode is set to Asynchronous mode. (0x01bd) |
drivers/net/hydra.c)| ECNTRL | Ethernet control register. It is set to 0x0003(ethernet enable) after setting all the other ethernet specific registers. |
|---|---|
| EDMA | Controls DMA unit. It is set to 0x002b. |
| EMRBLR | Determines the maximum size of the receive buffer. It is set to 0x0600. |
| IVEC | Controls the interrupt vector generated by the Ethernet controller. It is set to 0x0050. |
| INTR_MASK | Interrupt mask register. It is set to 0x0018 which enables only transmit and recieve frame interrupt. Other events like errors are all masked. |
| ECNFIG | Ethernet configuration register. It is set to 0x0000. |
| ETHER_TEST | Controls various manufacturing test modes. It is also set to 0x0000; |
| AR_CNTRL | Controls address recognition operation. It is set to 0x4000. |
- Kernel/User Compiler set :
m68k-coff.i386-linux-libc5.tar
m68k-pic-coff.i386-linux-libc5.tar
Or, use uClinux-gcc-RH5Intel.tar for RedHat 5.x.
(Actually, my system is RedHat 5.2, and I used
uClinux-gcc-RH5Intel.tar.)/usr/local/gnu/
directory and extracts tools under that directory. Make sure that
/usr/local/gnu/bin/ is on your path list.
These cross compilers are built with libc.5.4.38, so make sure that
your system has this version of libc.
uC-libc-060199.tar.bz2
uC-libm-060199.tar.bz2
These libraries are used for building user programs.
coff2flt-0.3.tar.gz
genromfs-0.3.tar.gz
The binary format of user program is `flat file format'. coff2flt
is used for changing `coff' binary to `flt' binary. genromfs is
used for generating romfs image.
not yet.
genromfs-0.3/ apps/ uC-libm/
coff2flt-0.3/ linux/ uC-libc/
How to Build/apps, and then copy the
romfs image to linux source directory(/linux) and build
the rom image(kernel + romfs). To build the rom image, follow these steps.
% make config
% make depend
% make updateromfs
The web server deals with `device controlling program' slight differently from usual CGI program. The `device controlling program' should have a special parameters. Here is an example of invoking and stopping `device controlling program'.
http://hydra0f.cs.washington.edu/dev_con?deviceACT http://hydra0f.cs.washington.edu/dev_con?deviceKILLWhen invoking or stopping a `device controlling program', the special parameter -
`deviceACT', `deviceKILL' - must be
specified. The `device controlling program' is different from usual CGI
programs. Usually, CGI program terminates just after returning http response
to the requesting host. But, the `device controlling program' keeps running
until the web server gets the `stop' request.`vfork()' system call.
(`fork()' is not supported.)`m68k-pic-coff-gcc',
and the linker is `m68k-pic-coff-ld'.
The format of the binary generated from the linker is `coff', but only
`flt' binary is runnable on uClinux. So, we have to convert `coff' binary
into `flt' binary, and coff2flt is used for that.Makefile.
CC = m68k-pic-coff-gcc
LD = m68k-pic-coff-ld
CFLAGS = -O2 -m68000 -g -fno-builtin -msoft-float -D__linux__ -DEMBED -I../../uC
-libc/include -I../../uC-libm
LDFLAGS = --embedded-relocs -T ../arch/embed/user.ld ../arch/embed/crt0.o
LIBS = ../../uC-libc/libc.a /usr/local/gnu/lib/gcc-lib/m68k-pic-coff/2.7.2.2-pic
-010298/libgcc.a
%.o: %.c
$(CC) $(CFLAGS) $< -c
all: sample
sample: sample.o
$(LD) $(LDFLAGS) $^ $(LIBS) -o $@.coff
../../coff2flt-0.3/coff2flt -o $@ $@.coff
clean:
rm -f *.o *.coff sample
Content-type : text/html\n\n)
to stdout.