From: Daniel M. <dan...@er...> - 2011-08-25 12:44:38
|
I would like you all to ask you another thing, a weird thing is happening to me: When I load the ramdisk driver using mkramdisk there is no problem, it creates it with a FAT16 filesystem that I can use. But when I load the driver using the shell cmd "load", like "load RAMDISK.efi" it creates it, and it looks like a FAT16 system when I analyse it with dblk, but it doesnt activate the filesystem or..I do not know, because I cannot do ls for example. Do you know why could it be? Thanks BR Daniel ________________________________ From: Joe Thomas [mailto:Joe...@do...] Sent: den 24 augusti 2011 20:27 To: edk...@li...; efi...@li... Subject: Re: [edk2] Toolkit applications as internal commands Daniel, I managed to do pretty much what you're looking to do under Edk1 by: a) Rewriting ramdisk.c to create a ramdisk.efi that was tailored to my needs b) Converting ramdisk.efi into a UINT8 array in a text file [ UINT8 RamDiskDriver[] = { <ascii bytes> }; } c) Hacking newshell/init.c to include the text file and then using BS->LoadImage() and BS->StartImage() to "load" the driver and start it. d) As extra functionality, it also "includes" a compressed disk image coded as above, and then uncompress'es the image onto the RamDisk. e) Coupled with a tftp client, I can PXE boot diskless and run a canned startup.nsh script that will download and execute additional apps - we use it to facilitate automated testing Anyways, the code looks something like: RamDiskDriver.h UINT8 RamDiskDriver[] = { 0x##, 0x##, 0x##... }; InitRamDisk.c #include "RamDiskDriver.h" ... // "Load" the driver Status = BS->LoadImage( FALSE, ParentImage, // Parent image handle from Shell NULL, RamDiskDriver, sizeof(RamDiskDriver), &ImageHandle // New image handle for RamDisk driver ); // If need be, find the LoadedImageProtocol handle for ImageHandle and set LoadOptions to your startup options. // For example, ala mkramdisk, LoadedImage->LoadOptions = L".\\ramdisk.efi 64"; // Start the driver if (!EFI_ERROR(Status)) Status = BS->StartImage( ImageHandle, NULL, NULL ); I did have some issues with the ramdisk being recognized and had to get the shell to execute a 'reconnect -r' and 'map -r' command by calling SEnvExecute()... Hope this provides some insight.... -Joe Thomas From: Daniel Moral [mailto:dan...@er...] Sent: Wednesday, August 24, 2011 5:40 AM To: edk...@li...; efi...@li... Subject: [edk2] Toolkit applications as internal commands Hi! I have been trying to develop a system to create a formatted RAM disk using the toolkit tool mkramdisk.efi which is used to load the driver ramdisk.efi. Now I would like to have this tool instaled as an internal command in my shell, so I do not need to use the external application everytime I need it. I have been trying to figure out how to solve the problem but I cannot. I have read the EFI_Shell_Developer_Guide_Ver0-91 where it is explained how to port an external to an internal command, and I was able to do it with an application I developed myself. But I cannot apply that to this case and I do not know where can I start looking. Could anyone help me a bit? Thanks! BR Daniel |