public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
* [Linux-ia64] Memory clearing at reboot
@ 2000-08-22 18:49 John Baboval
  2000-08-23  0:37 ` Saxena, Sunil
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: John Baboval @ 2000-08-22 18:49 UTC (permalink / raw)
  To: linux-ia64

[-- Attachment #1: Type: text/plain, Size: 1040 bytes --]

I have a small test program that I run at the EFI shell prompt to set an
area of memory and then perform a warm reboot. After the reboot our BigSur
still contains the values written, but the Lion is cleared to zero. (We
check the contents with the mem command, and the ResetSystem() is called
with the EfiResetWarm parameter.)

Does anyone know if there is a way to cause the Lion *not* to clear memory?
Also, our Lion has newer firmware then the BigSur. Perhaps the newer
firmware causes the reset? 

If someone out there has a BigSur with the latest firmware/CPU rev., could
you run my program and tell me if your machine resets it's memory? The
source code is attached, and you can build it with gnu-efi-0.9.

Basically, you run the program and write down the address, and then when the
machine comes back up type 'mem <Address>' and see if the memory is zero or
not.

Not reseting memory makes taking kernel core dumps with our in-memory core
dump patches MUCH easier! Thanks for any help,

-- 
--John
jbaboval@missioncriticallinux.com

[-- Attachment #2: set_reset.c --]
[-- Type: text/x-csrc, Size: 1339 bytes --]

#include <efi.h>
#include <efilib.h>

EFI_STATUS
efi_main (EFI_HANDLE image, EFI_SYSTEM_TABLE *systab)
{
	unsigned long bytes, mbytes;
	CHAR16 *prompt = W2U(L"Enter number of Mbytes: ");
	CHAR16 input[255];
	int input_len = 255;
	void *buffer;
	EFI_STATUS status;
	unsigned long i;
	long *temp;
	CHAR16 *ugh = W2U(L"test");

	InitializeLib(image, systab);

	Input(prompt, input, input_len);
	mbytes = Atoi(input);
	bytes = mbytes*1024*1024;

	Print (W2U(L"\nAllocating pool of %d bytes\n"), bytes);
	status = BS->AllocatePool(EfiBootServicesData, bytes, &buffer);

	if(status != EFI_SUCCESS) {
		Print(W2U(L"AllocatePool Failed with "));
		switch(status) {
			case EFI_OUT_OF_RESOURCES:
				Print(W2U(L"EFI_OUT_OF_RESOURCES\n"));
				break;
			case EFI_INVALID_PARAMETER:
				Print(W2U(L"EFI_INVALID_PARAMETER\n"));
				break;
			default:
				Print(W2U(L"%d\n"), status);
		}
		return status;
	}

	Print(W2U(L"Allocation succeeded. Buffer start :%016x\n"), buffer);

	Print(W2U(L"Setting Memory to 0xDEADBEEF"));
	for(i=0; i<bytes/8; i++) {
		temp = (long *)(buffer + i*8);
		*temp = (0xEFBEADDEEFBEADDE);
		if(((i*8)%(1024*1024)) == 0)
			Print(W2U(L"."));
	}

	Print(W2U(L"Press any key to reboot\n"));
        WaitForSingleEvent(ST->ConIn->WaitForKey, 0);
	RT->ResetSystem(EfiResetWarm, EFI_SUCCESS, 0, NULL);
		
	return EFI_SUCCESS;
}

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2000-08-23 23:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2000-08-22 18:49 [Linux-ia64] Memory clearing at reboot John Baboval
2000-08-23  0:37 ` Saxena, Sunil
2000-08-23  1:01 ` Gerrit.Huizenga
2000-08-23 23:16 ` Gerrit.Huizenga

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox