File: bootx.c

package info (click to toggle)
emile 0.10-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 1,716 kB
  • ctags: 2,737
  • sloc: ansic: 18,908; makefile: 726; asm: 622; sh: 2
file content (59 lines) | stat: -rw-r--r-- 1,641 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/*
 *
 * (c) 2005 Laurent Vivier <LaurentVivier@wanadoo.fr>
 *
 *
 */

#include "vga.h"
#include "bank.h"
#include "bootx.h"

struct boot_infos bootx_infos;

extern unsigned long machine_id;
extern unsigned long arch_type;

void bootx_init(char* command_line, 
		   char* ramdisk_start, unsigned long ramdisk_size)
{
	int i;

	//bootx_infos.version = BOOT_INFO_VERSION;
	bootx_infos.version = 4;
	bootx_infos.compatible_version = BOOT_INFO_COMPATIBLE_VERSION;

	bootx_infos.logicalDisplayBase = (u_int8_t*)vga_get_video();
	bootx_infos.machineID = machine_id;
	bootx_infos.architecture = arch_type;

	bootx_infos.deviceTreeOffset = 0;
	bootx_infos.deviceTreeSize = 0;

	bootx_infos.dispDeviceRect[0] = 0;			/* left */
	bootx_infos.dispDeviceRect[1] = 0;			/* top */
	bootx_infos.dispDeviceRect[2] = vga_get_width();	/* right */
	bootx_infos.dispDeviceRect[3] = vga_get_height();	/* bottom */
	bootx_infos.dispDeviceDepth = vga_get_depth();
	bootx_infos.dispDeviceBase = (u_int8_t*)vga_get_videobase();
	bootx_infos.dispDeviceRowBytes = vga_get_row_bytes();
	bootx_infos.dispDeviceColorsOffset = 0;

	bootx_infos.dispDeviceRegEntryOffset = 0;

	bootx_infos.ramDisk = (u_int32_t)ramdisk_start;
	bootx_infos.ramDiskSize = ramdisk_size;

	bootx_infos.kernelParamsOffset = (long)command_line - (long)&bootx_infos;

	for (i = 0; i < memory_map.bank_number; i++)
        {
               bootx_infos.physMemoryMap[i].physAddr = memory_map.bank[i].physAddr;
               bootx_infos.physMemoryMap[i].size = memory_map.bank[i].size;
        }

	bootx_infos.physMemoryMapSize = i;

	bootx_infos.frameBufferSize = 0;
	//bootx_infos.totalParamsSize
}