Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
854 serge 1
 
2
 
3
4
#include "multiboot.h"
5
 
6
extern u32_t pg_balloc;
7
 
8
extern u32_t mem_amount;
9
 
10
extern u32_t rd_fat      ;
11
extern u32_t rd_fat_end  ;
12
extern u32_t rd_root     ;
13
extern u32_t rd_root_end ;
14
15
extern multiboot_info_t *boot_mbi;
16
 
17
/* Check if the bit BIT in FLAGS is set.  */
18
 
19
20
void init()
21
 
22
   u32_t   last_page = 0;
23
24
   if (CHECK_FLAG (boot_mbi->flags, 1))
25
 
26
27
  /* Is the command line passed?  */
28
 
29
     printf ("cmdline = %s\n", (char *) boot_mbi->cmdline);
30
31
  /* Are mods_* valid?  */
32
 
33
   {
34
     module_t *mod;
35
     int i;
36
37
     printf ("mods_count = %d, mods_addr = 0x%x\n",
38
 
39
     for (i = 0, mod = (module_t *) boot_mbi->mods_addr;
40
          i < boot_mbi->mods_count;i++, mod++)
41
     {
42
        pg_balloc = mod->mod_end;
43
        printf (" mod_start = 0x%x, mod_end = 0x%x, string = %s\n",
44
              (u32_t) mod->mod_start,(u32_t) mod->mod_end, (char *) mod->string);
45
     };
46
     mod--;
47
     rd_base     = mod->mod_start+OS_BASE;
48
     rd_fat      = rd_base + 512;
49
     rd_fat_end  = rd_base + 512 + 4278;
50
     rd_root     = rd_base + 512*19;
51
     rd_root_end = rd_base + 512*33;
52
     printf(" rd_base = %x\n", rd_base);
53
   }
54
55
   if (CHECK_FLAG (boot_mbi->flags, 6))
56
 
57
      memory_map_t *mmap;
58
      u32_t page;
59
60
      printf ("mmap_addr = 0x%x, mmap_length = 0x%x\n",
61
 
62
63
      for (mmap = (memory_map_t *) boot_mbi->mmap_addr;
64
 
65
           mmap = (memory_map_t *) ((u32_t) mmap
66
				    + mmap->size + sizeof (mmap->size)))
67
      {
68
         u32_t page;
69
70
         printf (" size = 0x%x, base_addr = 0x%x%x,"
71
 
72
                 (unsigned) mmap->size,
73
                 (unsigned) mmap->base_addr_high,
74
                 (unsigned) mmap->base_addr_low,
75
                 (unsigned) mmap->length_high,
76
                 (unsigned) mmap->length_low,
77
                 (unsigned) mmap->type);
78
79
         if( mmap->type != 1)
80
 
81
         page = (mmap->base_addr_low+mmap->length_low)&(~4095);
82
         if(page > last_page)
83
         last_page = page;
84
      }
85
   }
86
87
   if(last_page > 256*1024*1024)
88
 
89
90
   mem_amount = last_page;
91
 
92
 };
93