Hello dear guest!

Boot Land is a community driven pc software site established since 2006 and focused on recovery/backup boot disks, research of Microsoft Windows 2000/XP/2003/Vista/7 install/deployment/lease/antivirus/antispam tools, customizing Microsoft Windows PE administration systems and even learning how to recover computer data from disaster situations!

How about joining our boot disk community? So do it. Life's short!

  - You get free access to our newsletter with all the interesting buzz about boot disks
  - We share publicity revenue with everyone who wishes to participate at the forums
  - Publicity is never, never, never displayed to members (along with many other cool things)
http://boot-land.net/register


 RAM load part of a file
post May 31 2010, 08:49 PM
Post #1
cdob
Frequent Member   ***
Group: Advanced user

  Joined: 7-November 07
Posts: 295
Thank(s): 62


Given a sorted image file: all boot data are in front of media.

Example:
Slax 6.1.2 boot directory use 3727 sectors.
First level booting use 3727 sectors.

Imagine a fragmented file slax-6.1.2.iso at USB stick
'map --mem slax-6.1.2.iso' does load whole file to RAM.
Kernel and initrd are read from RAM disk.
But next file slax-6.1.2.iso is read from USB stick. That's a waste of time and waste of RAM.

At ISO file boot there is no need to load whole ISO image to RAM.
It's sufficient to load 3727 sectors to RAM.

Given a continuous file (working example loading 3727 sectors):
CODE
map /slax/slax-6.1.2.iso (0xFE)
map --hook
map --mem (0xFE)+3727 (0xFF)
map --hook
root (0xFF)
kernel /boot/vmlinuz from=/slax/slax-6.1.2.iso ramdisk_size=6666 root=/dev/ram0 rw autoexec=xconf;telinit~4
initrd /boot/initrd.gz



How to RAM load first part of a fragmented file?

This fails
CODE
map --mem (/slax/slax-6.1.2.iso)+3727 (0xFE)
Error 23: Error while parsing number


Or a special fake multi session file, load middle part of a file
CODE
map --mem (multi_session.iso)1234+3727 (0xFE)


+Quote Post
 
Start new topic
Replies (1 - 9)
post May 31 2010, 11:06 PM
Post #2
tinybit
Frequent Member   ***
Group: Developer

  Joined: 14-August 07
Posts: 462
Thank(s): 63


China


At present, you may

1. defragment your ISO(so don't have to use --mem). This is an extra work and is somewhat inconvenient. But it is a work once and for all.

2. switch to grub2, which has a builtin loop mount feature, suitable for booting up Linux ISOs. In this way you don't have to map anything.

3. extract vmlinuz and initrd from the ISO before booting. This way you don't have to map anything, either.
+Quote Post
post Jun 1 2010, 07:50 AM
Post #3
Wonko the Sane
Gold Member   *****
Group: Advanced user

  Joined: 8-January 10 From: The Outside of the Asylum

Posts: 1,438
Thank(s): 155


Italy


@cdob
Maybe this could be the right occasion to do something about the old and never finalized idea of OFS? unsure.gif
http://www.boot-land.net/forums/index.php?...=2887&st=30
and to continue along the path initially ideated by COD11?:
http://www.boot-land.net/forums/index.php?...ic=9916&hl=

@all
What about some dd work?
Access the .iso, get from it the two needed files (kernel+initrd), make on-the-fly (or expand an empty, pre-formatted gzipped smallish image, maybe FAT12) copy them to (rd), boot from it? dubbio.gif
Something along the lines of the the old HMLOAD?

cheers.gif
Wonko


--------------------

Light Blue Ribbon Campaign for Freedom of Skin

But ... then, why?
+Quote Post
post Jun 1 2010, 10:19 AM
Post #4
tinybit
Frequent Member   ***
Group: Developer

  Joined: 14-August 07
Posts: 462
Thank(s): 63


China


yes, dd may work:

CODE
# firstly, use dd to copy the beginning 3727 sectors of the ISO at physical
# address 32M(=0x10000 in 512-byte sectors). 3727*2048/512=14908
dd if=()/slax/slax-6.1.2.iso of=(md)0x10000+14908 bs=2048 count=3727
# secondly, setup (rd) to point to address 32M
map --rd-base=0x2000000
# thirdly, setup rd-size to 3727 big-sectors(=7632896 bytes). 1 big-sector=2048 bytes.
map --rd-size=7632896
# now (rd) is the initial portion(3727 big-sectors) of the ISO, hopefully work in this case.
kernel (rd)/boot/vmlinuz from=/slax/slax-6.1.2.iso ramdisk_size=6666 root=/dev/ram0 rw autoexec=xconf;telinit~4
initrd (rd)/boot/initrd.gz


In this example, even no virtual cdrom is required. Only a piece of memory at 32M is used as a temp space for the ISO.

If vmlinuz or initrd too large, you need to adjust the address 32M to a higher one.
+Quote Post
post Jun 1 2010, 10:49 AM
Post #5
Wonko the Sane
Gold Member   *****
Group: Advanced user

  Joined: 8-January 10 From: The Outside of the Asylum

Posts: 1,438
Thank(s): 155


Italy


thumbup.gif
worship.gif

BUT:

QUOTE (tinybit @ Jun 1 2010, 12:19 PM) *
bs=512


dubbio.gif

The sectors on CD/.iso are 2048 bytes in size.

Then it should be 3727*4=14908 unsure.gif



NEVERMIND: cross-posting smile.gif


cheers.gif
Wonko


--------------------

Light Blue Ribbon Campaign for Freedom of Skin

But ... then, why?
+Quote Post
post Jun 4 2010, 10:15 PM
Post #6
cdob
Frequent Member   ***
Group: Advanced user

  Joined: 7-November 07
Posts: 295
Thank(s): 62


QUOTE (tinybit @ Jun 1 2010, 12:19 PM) *
In this example, even no virtual cdrom is required. Only a piece of memory at 32M is used as a temp space for the ISO.
Thanks, that's awesome. Yes, this works.

Addional there are examples with a virtual cdrom.

General approach: continuous or fragmented ISO file, low RAM usage.
CODE
title Slax\n Slax Core 6.1.2 - partial map --mem
write 0x10000 0
map /slax/slax-6.1.2.iso (0xff) || write 0x10000 1
#4x 3727 cd sectors = 14908 md sector = 7632896 bytes
read 0x10000 && map --mem (md)0x10000+14908 (0xff)
map --hook
read 0x10000 && dd if=()/slax/slax-6.1.2.iso of=(0xff) bs=7632896 count=1
root (0xff)
kernel /boot/vmlinuz from=/slax/slax-6.1.2.iso ramdisk_size=6666 root=/dev/ram0 rw autoexec=xconf;telinit~4
initrd /boot/initrd.gz


And there are virtual cdrom drivers firadisk/WinVBlock.
Idea: load PE part to RAM. Boot PE and mount whole disc.

Anyway the dd RAM approach offers a lot of possibilities.
Thanks to the Finder.
+Quote Post
post Jun 5 2010, 06:57 PM
Post #7
maanu
Silver Member   ****
Group: Advanced user

  Joined: 31-October 08
Posts: 868
Thank(s): 137


Pakistan


QUOTE (cdob @ Jun 4 2010, 11:15 PM) *
Thanks, that's awesome. Yes, this works.

Addional there are examples with a virtual cdrom.

General approach: continuous or fragmented ISO file, low RAM usage.
CODE
title Slax\n Slax Core 6.1.2 - partial map --mem
write 0x10000 0
map /slax/slax-6.1.2.iso (0xff) || write 0x10000 1
#4x 3727 cd sectors = 14908 md sector = 7632896 bytes
read 0x10000 && map --mem (md)0x10000+14908 (0xff)
map --hook
read 0x10000 && dd if=()/slax/slax-6.1.2.iso of=(0xff) bs=7632896 count=1
root (0xff)
kernel /boot/vmlinuz from=/slax/slax-6.1.2.iso ramdisk_size=6666 root=/dev/ram0 rw autoexec=xconf;telinit~4
initrd /boot/initrd.gz


And there are virtual cdrom drivers firadisk/WinVBlock.
Idea: load PE part to RAM. Boot PE and mount whole disc.

Anyway the dd RAM approach offers a lot of possibilities.
Thanks to the Finder.


you mean a windows pe iso can also be booted to ram PARTIALLY ? but i suppose it got to be simple PE , not the WIMBOOT based or BOOTSDI based , because the pe is packed all in one file in this . or am i missing something ?
+Quote Post
post Jun 6 2010, 10:02 AM
Post #8
Wonko the Sane
Gold Member   *****
Group: Advanced user

  Joined: 8-January 10 From: The Outside of the Asylum

Posts: 1,438
Thank(s): 155


Italy


QUOTE (maanu @ Jun 5 2010, 08:57 PM) *
you mean a windows pe iso can also be booted to ram PARTIALLY ? but i suppose it got to be simple PE , not the WIMBOOT based or BOOTSDI based , because the pe is packed all in one file in this . or am i missing something ?


No, it would be pretty much pointless even in the case of a non-packed PE.

A linux boot, very basically is made of three "parts":
  1. kernel <- say a handful of mbytes in size
  2. initrd <- say several mbytes in size
  3. anything else <- whatever size, usually a few hundreds of megabyte in size


What the suggested methods does is to shorten the loading time.

The usual map --mem .iso way:
  1. WHOLE .iso is loaded from media to RAM (say that 300 Mbytes are transferred), once booted kernel and initrd anything else is unused as
  2. the linux loads "all the rest" directly from media


The newish approach:
  1. ONLY kernel and initrd are loaded into RAM (say that 30 Mbytes are transferred), once booted kernel and initrd
  2. the linux loads "all the rest" directly from media


The structure of a PE is more "monolithic", though one can use as it has been done in the past a "core" and a second image with apps and what not.

The new (finally yahoo.gif) approach of direct image mapping with WinVblock and Firadisk appears like more suitable for PE's, as well as for "full" NT based systems.

cheers.gif
Wonko


--------------------

Light Blue Ribbon Campaign for Freedom of Skin

But ... then, why?
+Quote Post
post Jun 6 2010, 03:47 PM
Post #9
MedEvil
Platinum Member   ******
Group: .script developer

  Joined: 29-December 06
Posts: 5,110
Thank(s): 145


Well there is one more use for it, a PE use. smile.gif

There is a drawbacks from the improve CDVD structure, which cdob tries to overcome.

cheers.gif


--------------------
NaughtyPE - The Multimedia PE!
Requirements: WinBuilder080, XPSP2/W2k3SP1 source, Pentium CPU, 128MB RAM (256MB to use video players)
+Quote Post
post Jun 7 2010, 04:19 AM
Post #10
cdob
Frequent Member   ***
Group: Advanced user

  Joined: 7-November 07
Posts: 295
Thank(s): 62


QUOTE (maanu @ Jun 5 2010, 08:57 PM) *
you mean a windows pe iso can also be booted to ram PARTIALLY ? but i suppose it got to be simple PE , not the WIMBOOT based or BOOTSDI based , because the pe is packed all in one file in this . or am i missing something ?

Idea was a flat file ISO image.
RAM load core boot file (I386), run PE, mount full CD/ISO image (programs) and read files from CD/ISO image next.

What about a disk image with empty sectors at end?
RAM load only first part with used sectors.


Actually RAM loading parts offers a lot of possibilities.

Random ideas:

Basic usage: Burn ISO image to CD. Boot from CD.

RAM load part of CD. Boot from RAM. Mount whole CD, continue booting.
Or RAM load part of CD. Boot from RAM. Mount programs from USB. Continue booting.

Boot from USB:
much RAM: load whole PE to RAM
low RAM: load core boot part to RAM. Mount missing parts at boot.

Load filesystem and data part independent.
Turn a real CD to a hard disk image in RAM
Create a file containing a fake FAT filesystem. RAM load CD. dd filesystem file to RAM.

Boot the loop 2: use two ISO9600 filesystems.

Or Kansas City Shuffle without a image file at USB1.1 speed BIOS.
Partition and format a USB stick. Copy sorted files to USB stick, copy boot files first.
RAM load first part of USB stick. Chainload setupldr.bin.
First part are read from RAM disk, USB 2.0 drivers are loaded.
Booting finish using USB stick at USB2.0 speed.
+Quote Post

Reply to this topic
1 User(s) are reading this topic ()



Collapse

  Topic Replies Topic Starter Views Last Action
No new File-system redirection
20 target_practice 1,199 13th June 2010 - 11:52 PM
Last post by: Galapo
No New Posts Load ISO with MEMDISK using HTTP not TFTP
6 ninjabilly 221 11th June 2010 - 08:52 PM
Last post by: ninjabilly
No New Posts Office 2010 Web Apps live | Free Microsoft eBooks | SCVMM 2008 R2 Rollup released | Windows Phone 7 news
0 Michael Pietroforte 76 8th June 2010 - 09:38 PM
Last post by: Michael Pietroforte
No New Posts Offline insert ide,ahci drivers
Go home acronis ur =))
5 cyb_fh 561 4th June 2010 - 08:17 PM
Last post by: hackules
No New Posts Office 2010 activation - How to rearm Office 2010
0 Michael Pietroforte 356 26th May 2010 - 09:23 PM
Last post by: Michael Pietroforte





    

Display Mode: Switch to: Standard · Linear+ · Switch to: Outline