UINTN high_ext_mem = 32 * 1024 * 1024;
/* This starting address will hold true for all of the loader types for now */
-VOID *kernel_start = (VOID *)0x100000; /* 1M */
+VOID *kernel_start = (VOID *)DEFAULT_KERNEL_START;
+
+/* The kernel may load elsewhere if EFI firmware reserves kernel_start */
+VOID *kernel_load_address = (VOID *)DEFAULT_KERNEL_START;
VOID *initrd_start = NULL;
UINTN initrd_size = 0;
DBG_PRT((L"initrd_get_addr()\n"));
if (!kd || !imem) {
- ERR_PRT((L"kd=0x%x imem=0x%x", kd, imem));
+ ERR_PRT((L"kd=" PTR_FMT " imem=" PTR_FMT, kd, imem));
return -1;
}
- VERB_PRT(3, Print(L"kstart=0x%x kentry=0x%x kend=0x%x\n",
+ VERB_PRT(3, Print(L"kstart=" PTR_FMT " kentry=" PTR_FMT " kend=" PTR_FMT "\n",
kd->kstart, kd->kentry, kd->kend));
imem->start_addr = kd->kend;
- VERB_PRT(3, Print(L"initrd start_addr=0x%x pgcnt=%d\n",
+ VERB_PRT(3, Print(L"initrd start_addr=" PTR_FMT " pgcnt=%d\n",
imem->start_addr, imem->pgcnt));
return 0;
}
+VOID *
+sysdeps_checkfix_initrd(VOID *start_addr, memdesc_t *imem)
+{
+ return start_addr;
+}
+
VOID
sysdeps_free_boot_params(boot_params_t *bp)
{
free_memmap(&md);
}
+static VOID find_bits(unsigned long mask, UINT8 *first, UINT8* len) {
+ unsigned char bit_pos = 0, bit_len = 0;
+ *first =0;
+ *len = 0;
+ if (mask == 0)
+ return;
+ while (!(mask & 0x1)) {
+ mask = mask >> 1;
+ bit_pos++;
+ }
+ while (mask & 0x1) {
+ mask = mask >> 1;
+ bit_len++;
+ }
+ *first = bit_pos;
+ *len = bit_len;
+}
+
/*
* Get video information.
*/
EFI_GUID GopProtocol = EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID;
EFI_GRAPHICS_OUTPUT_PROTOCOL *Gop_interface;
EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *Gop_info;
- EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE *Gop_mode;
- EFI_HANDLE *Gop_handle;
+ EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE *Gop_mode = NULL;
+ EFI_HANDLE *Gop_handle = NULL;
EFI_STATUS efi_status;
- UINTN size, size1;
+ UINTN size = 0;
+ UINTN size1;
UINT8 i;
efi_status = uefi_call_wrapper(
(VOID **)Gop_handle);
if (EFI_ERROR(efi_status) && efi_status != EFI_BUFFER_TOO_SMALL) {
- ERR_PRT((L"LocateHandle GopProtocol failed."));
+ Print(L"LocateHandle GopProtocol failed.\n");
+ Print(L"--Either no graphics head is installed,\n" \
+ "--efi console is set to serial, or,\n" \
+ "--the EFI firmware version of this machine is\n" \
+ "--older than UEFI 2.0. and does not support GOP");
+ Print(L"you can SAFELY IGNORE this error. elilo will\n" \
+ "default to text-mode.\n Alternatively you can " \
+ "now force text mode by setting config variable\n" \
+ "text_mode=1 for x86 in elilo.conf or via cmdline.\n\n");
+ Print(L"However if this is the last text output you see\n" \
+ "ensure that your kernel console command line\n " \
+ "variable matches up with the actual efi boot menu\n" \
+ "console output settings. for example efi console\n\n");
return -1;
}
Gop_handle = alloc(size, 0);
3,
*Gop_handle,
&GopProtocol,
- &Gop_interface);
+ (VOID **) &Gop_interface);
if (EFI_ERROR(efi_status)) {
continue;
DBG_PRT((L"fill_boot_params()\n"));
if (!bp || !cmdline || !initrd || !cookie) {
- ERR_PRT((L"bp=0x%x cmdline=0x%x initrd=0x%x cookie=0x%x",
+ ERR_PRT((L"bp=" PTR_FMT " cmdline=" PTR_FMT " initrd=" PTR_FMT " cookie=" PTR_FMT,
bp, cmdline, initrd, cookie));
if (param_start != NULL) {
* Initial RAMdisk and root device stuff.
*/
- DBG_PRT((L"initrd->start_addr=0x%x initrd->pgcnt=%d\n",
+ DBG_PRT((L"initrd->start_addr=" PTR_FMT " initrd->pgcnt=%d\n",
initrd->start_addr, initrd->pgcnt));
/* These RAMdisk flags are not needed, just zero them. */
#define WAIT_FOR_KEY() \
{ \
EFI_INPUT_KEY key; \
- while (ST->ConIn->ReadKeyStroke(ST->ConIn, &key) != EFI_SUCCESS) { \
+ while (uefi_call_wrapper(ST->ConIn->ReadKeyStroke, 2, ST->ConIn, &key) != EFI_SUCCESS) { \
; \
} \
}
if (!get_video_info(bp)) goto do_memmap;
- efi_status = ST->ConOut->QueryMode(
+ efi_status = uefi_call_wrapper(
+ ST->ConOut->QueryMode,
+ 4,
ST->ConOut,
ST->ConOut->Mode->Mode,
&cols,