Back to home page

LXR

 
 

    


File indexing completed on 2025-05-11 08:23:57

0001 #include <bsp/bootcard.h>
0002 #include <bsp/linker-symbols.h>
0003 
0004 static void
0005 __outb(int port, unsigned char v)
0006 {
0007   *((volatile unsigned char *)(0x80000000 + port)) = v;
0008 }
0009 
0010 #if 0
0011 /* currently unused but keep just in case */
0012 
0013 static unsigned char
0014 __inb(int port)
0015 {
0016   return *((volatile unsigned char *)(0x80000000 + port));
0017 }
0018 #endif
0019 
0020 static void
0021 __memcpy (void *dv, void *sv, size_t len)
0022 {
0023   unsigned char *d = (unsigned char *) dv;
0024   unsigned char *s = (unsigned char *) sv;
0025 
0026   while (len--)
0027     *d++ = *s++;
0028 }
0029 
0030 static void
0031 __bzero (void *dv, size_t len)
0032 {
0033   unsigned char *d = (unsigned char *) dv;
0034 
0035   while (len--)
0036     *d++ = 0;
0037 }
0038 
0039 
0040 /*
0041  * Prototype this here because it is just the entry symbol and
0042  * not referenced from any compileable code.
0043  */
0044 void cmain (void);
0045 
0046 void cmain (void)
0047 {
0048   /*
0049    * init variable sections
0050    */
0051   __memcpy(
0052     (char *)bsp_section_data_begin,
0053     (char *) bsp_section_data_load_begin,
0054     (int)bsp_section_data_size
0055    );
0056   __bzero((char *)bsp_section_bss_begin, (int)bsp_section_bss_size);
0057   __bzero((char *)bsp_section_sbss_begin, (int)bsp_section_sbss_size);
0058   /* printk( "start of BSP\n"); */
0059   boot_card(0);
0060   /* printk( "end of BSP\n"); */
0061   __outb (0x92, 0x01);
0062   while (1)
0063     ;
0064 }