Jump to content











Photo
- - - - -

Question: Mount a folder as a drive (in ram)


  • Please log in to reply
67 replies to this topic

#26 betrand

betrand

    Frequent Member

  • Advanced user
  • 467 posts
  •  
    France

Posted 08 February 2012 - 01:24 PM

Or, guys, the other way round:
I have files on a stick I wanna use from Dos without loading drivers. Rephrase, without having to use drivers.
I could use usb drivers for a stick, Cdrom drivers for a CD.
But the thing here would make things more 'universal' if I may.

#27 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 15176 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 08 February 2012 - 01:31 PM

Also, and AGAIN, FAT makes NO sense whatever:
  • FAT12
  • FAT16
  • FAT32
  • exFAT
What you lately described is definitely the OFS I already linked you to.

This:

Or, guys, the other way round:
I have files on a stick I wanna use from Dos without loading drivers. Rephrase, without having to use drivers.
I could use usb drivers for a stick, Cdrom drivers for a CD.
But the thing here would make things more 'universal' if I may.

is again NOT understandable (to me).


:cheers:
Wonko

#28 betrand

betrand

    Frequent Member

  • Advanced user
  • 467 posts
  •  
    France

Posted 08 February 2012 - 01:34 PM

'proof of concept' project that has no practical application

:suda:
Yeah, I know.
It started off as just me thinking, hm, this might be easy. Then, I saw there was a bit more.
Scenario, I booted a drive the other day, from grub4dos loading a Dos image. It should have picked up the Physical drive, but didnt.
So I was stuck with just that small Dos image, with no access to the files off from the physical drive.
I like to he these files 'open', ie not inside an image, to see easily what I've got.
THAT'S when this **long winded*** idea came round.
mapping the already existing files to RAM. Using Grub4Dos as a driver, so to speak.

Boarf.

Thanks for the answers though, might come useful some day. :P
Sorry also for the Already asked questions I re-asked.

Cherio!

#29 betrand

betrand

    Frequent Member

  • Advanced user
  • 467 posts
  •  
    France

Posted 08 February 2012 - 03:30 PM

Hi again.
Been away, Am back.

Yep. OFS. :)
As they say on the page, nice concept.
When you mentionned OFS, I thought you had pointed me to something about an OS (OSF?). As there are so many Ideas usualy about how to boot 'insert OS name here' OS from ram, to ram, from Usb, from Logical, from what you wish, I thought, uhuu, another page with Tons of links.
In fact, no. :) :)
Might one call it a bump?
Neat stuff.
I feel I should write more praise, but I'll go and read /see, etc the files.

:P

#30 betrand

betrand

    Frequent Member

  • Advanced user
  • 467 posts
  •  
    France

Posted 08 February 2012 - 03:54 PM

Also, and AGAIN, FAT makes NO sense whatever:

File Allocation Table. I used it in the sense 'database of the files'. (not FS)

Cheers, Time running out.

:)

#31 betrand

betrand

    Frequent Member

  • Advanced user
  • 467 posts
  •  
    France

Posted 11 February 2012 - 06:07 PM

NO filesystem (not "FAT", FAT table(s) is/are part of the filesystem, that includes bootsector/PBR, reserved sectors, FAT(s) and in the case of FAT12/16, reserved space for ROOT entries) is created or harmed in these processes.

:cheers:
Wonko


I blame Microsoft a bit for some misunderstanding. File Allocation Table would, in the real world, mean the table of allocation of files. I.e., a database-like system. For Files.
But here in fact a FAT is the allocations of clusters for files. Files names are in fact in the Root directory.
In the real world, File allocation table would mean an index. Anyway I find Cluster Allocation Table would have been more meaningful. Or a longer Cluster Allocation Table For The Files. Someone from the real world reading File allocation Table would say, 'that's where files are allocated, like, indexed.'


Anyhow, reading http://reboot.pro/16328/ Low Ram Warning, MD stood-out. THen reading the Grub4dos readme, RD.
If I carry on in the topic, I'll look into that.

Just to mention, Looked at OFS. Shame it didn't carry on.
Good work, though.

#32 betrand

betrand

    Frequent Member

  • Advanced user
  • 467 posts
  •  
    France

Posted 11 February 2012 - 06:56 PM

So,

Thank you, Steve6375,

(md)0x300+1

(http://reboot.pro/16328/)

So one can have an empty Ramdrive. Then fatcopy (Chenall) a zip to it.
Map a Dos floppy image (carefully avoiding the Ramdisk created in step one). Boot the Dos Floppy image.
Unzip the Zipped file to ram.
Like that I can have my Dos tools in something other than an image file. A zip file is more common.
For the sake of Ram, I don't want to map the whole real physical drive.

I won't need a driver for the dive from dos.

I still would like to map a folder as a drive though.
I see the only similar way IS OFS.

Question. If one maps a md. What filesystem is it?


Cool.

#33 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 15176 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 11 February 2012 - 09:09 PM

Question. If one maps a md. What filesystem is it?

Filesystem: RAW
(EXACTLY like an unpartitioned and unformatted device).

And NO (IMHO).
FAT is a perfectly correct name.
What you find in the FAT is the allocation table for files.
This allocation table is expressed in cluster numbers.
Each entry in the table tells you exactly which clusters are occupied by a given file.
The index to this allocation table resides elsewhere.

I won't need a driver for the dive from dos.

No, not if you map it in BIOS and DOS hooks the BIOS, otherwise, yes, you will need a driver.
Or you will need to map another (empty) image, and find a program that reads a RAW chunk of memory, and writes to the formatted filesystem of the mapped image as a file. (dd or similar)

hey, wait, grub4dos already has dd! ;)

:cheers:
Wonko

#34 steve6375

steve6375

    Platinum Member

  • Developer
  • 7186 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films,guitars, www.easy2boot.com
  •  
    United Kingdom

Posted 17 February 2012 - 12:03 PM

Here is a way to have a folder with 8.3 files in a ram drive and have it accessible from MS-DOS. This means that you can have files in a folder on your CD and they will be accessible to MS-DOS without the need to load MS-DOS CD drivers.

Have a folder on your boot CD called XFER. Boot from the CD to grub4dos and call the batch file below. Then run MS-DOS and it (fd1 - drive B:) will have the folder contents and the contents of the root of the CD.

MENU.LST
title MS-DOS with CD folder XFER and root CD files on FD1

cdrom --init

find --set-root /cf.bat

call /cf.bat XFER

find --set-root /io.sys

chainloader /io.sys


cf.bat

!BAT

# do not stop on errors (e.g. filename not 8.3)

errorcheck off

debug off

find --set-root /fat

map --mem (md)0x800+0x16000 (fd1)

map --hook

map --floppies=2

/fat mkfs (fd1)

set FF=%1

/fat mkdir (fd1)/%FF%

ls (cd)/	  | call :copyroot

echo root files copied

ls (cd)/%FF%/ | call :copyFF

clear

echo

echo

echo FLOPPY FD1

echo ----------

ls (fd1)/

ls (fd1)/%FF%/

exit 0



:copyFF

if "%1"=="" goto :eof

/fat copy (cd)/%FF%/%1 (fd1)/%FF%/ || echo copy from (cd)/%FF%/%1 FAILED!

#clear

shift

goto :copyFF



:copyroot

if "%1"=="" goto :eof

/fat copy (cd)/%1 (fd1)/ || echo copy from echo (cd)/%1 FAILED!

#clear

shift

goto :copyroot



When you boot to DOS, drive B: will now contain the same files that were on the CD in the root and also a folder XFER with files in it.

FD1 Contents
/ all files that were on root of CD
/XFER/ all files that were on CDXFER folder

There are quite a few problems with this though...
1. Only 8.3 filenames will be copied
2. All filenames on fd1 will be lowercase
3. Number of files that will copy will be limited (approx. 255 per folder for shift limit??) - so does not work for the I386 folder!
4. The grubutil utility fat is needed
5. grub4dos may scroll the screen and prompt 'hit Q to Quit or any key to continue' - if this occurs unREM the clear lines so it clears the screen on every file copy (is there a way to suppress this prompt??)
6. The ram drive is located at 800 hex sectors = 1 Megabyte and is 45MB in size - you may need to adjust this! Especially if your MS-DOS drivers/utilities use extended memory in the same area!

I have not tested this on a real bootable CD which has a floppy boot component - you may need to change the menu.lst to make sure it boots MSDOS from the correct device.
The copying of the files on the root of the CD is optional (just comment out the relevant line).
You can copy more than one folder - just add more mkdir, set and call lines.

Many thanks to chenall for the hint on using piping with ls to make this work!

#35 betrand

betrand

    Frequent Member

  • Advanced user
  • 467 posts
  •  
    France

Posted 17 February 2012 - 08:20 PM

Woohoo! you' re the best!
I'll read now :)

-Reading, reading.
-Have read.
-Will read again in future to 'get' the thing'

It is really awsome (well I mean on the Dos No Drivers level ;)). I didn't think anyone would come up with it,
let alone even spend time trying to work this one out. :thumbup:
And

/fat mkfs (fd1)

?? Cool!

And the rest I will read, again.
Question, does the XFER have to be XFER, or can I have it whatever I want?


Would the I386 of Xpcli (not) work? ;)

:)

#36 steve6375

steve6375

    Platinum Member

  • Developer
  • 7186 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films,guitars, www.easy2boot.com
  •  
    United Kingdom

Posted 17 February 2012 - 08:38 PM

As in the post, i386 will not work - only up to 255 files per folder can be copied, Also subfolders are not copied.
To copy a different folder just change set FF=xxxx to whatever folder you want to copy (and change the mkdir line as well.)

#37 betrand

betrand

    Frequent Member

  • Advanced user
  • 467 posts
  •  
    France

Posted 17 February 2012 - 08:47 PM

Yeah, just thought the i386 of Xpcli would be smaller. But if anyway, as mentionned on Chenall's page also, subfolders are not copied, no worries.
About XFER, yeah, I know, was just checking in case the name was a limitation by Grub4dos..

It is, btw, an honour to have you answer a topic :)
:) (well, I mean, everyone, but, :worship: RmprepUsb.

#38 steve6375

steve6375

    Platinum Member

  • Developer
  • 7186 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films,guitars, www.easy2boot.com
  •  
    United Kingdom

Posted 17 February 2012 - 10:06 PM

I have slightly modified the menu.lst and cf.bat so that you can specify the name of the folder you want to copy in the menu.lst file - e.g. call /cf.bat XXXX

#39 chenall

chenall

    Member

  • Members
  • 60 posts
  •  
    China

Posted 18 February 2012 - 01:52 AM

try this script for copy cd to (fd1) (with 8.3 filename only).



!BAT

::::copy cd to virtual drive (fd1)

debug off

map --mem (md)+0x16000 (fd1)

map --hook

fat mkfs (fd1)

root (cd)

set cd=



:cpa

::echo Current Root: %cd%

::Change source root

root (cd)%cd%/

ls | call :copyfiles=

goto :eof



:copyfiles

if "%1"=="" goto :eof

::If is a directory

cat --length=0 /%1 || goto :sub-dir

::copy file

fat copy /%1 (fd1)%cd%/ > nul || echo Error: %cd%/%1

shift

goto :copyfiles

:sub-dir

setlocal

fat mkdir (fd1)%cd%/%1

set cd=%cd%/%1

call :cpa

endlocal

shift

goto :copyfiles

Edited by chenall, 18 February 2012 - 02:00 AM.


#40 steve6375

steve6375

    Platinum Member

  • Developer
  • 7186 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films,guitars, www.easy2boot.com
  •  
    United Kingdom

Posted 18 February 2012 - 12:59 PM

Modified and tested - thanks chenall! You can specify the size you want for the virtual floppy.
So now the whole CD including sub-directories can be copied to the (fd1) virtual drive (up to 255 files per folder).

menu.lst

# specify 512MB

call (bd)/cpycd.bat 0x100000


cpycd.bat

!BAT

::::copy cd to virtual drive (fd1)

debug off

errorcheck off

#512MB = 0x100000

#850MB = 0x1A0000

#1GB = 0x200000

map --mem (md)0x300+%1 (fd1)

map --hook

debug on

clear

(bd)/fat mkfs (fd1)

debug -1

pause --wait=3

debug off

root (cd)

set cd=

call :cpa

echo Finished!

map --floppies=2

goto :eof





:cpa

clear

echo Copying files in folder: %cd%

::Change source root

root (cd)%cd%/

ls | call :copyfiles

echo Finished folder %cd%

goto :eof



:copyfiles

if "%1"=="" goto :eof

::If is a directory

cat --length=0 /%1 || goto :sub-dir



::copy file

echo  %cd%/%1

(bd)/fat copy /%1 (fd1)%cd%/ > nul || echo Error: %cd%/%1

shift

goto :copyfiles



:sub-dir

setlocal

(bd)/fat mkdir (fd1)%cd%/%1

set cd=%cd%/%1

call :cpa

endlocal

shift

goto :copyfiles



#41 betrand

betrand

    Frequent Member

  • Advanced user
  • 467 posts
  •  
    France

Posted 18 February 2012 - 01:28 PM

Hi guys,
Thanks.
Tak so mycket (sw)

Irony is, I cant try it myself, I've not got much spare time.
I'm sure others will, and I will when I can.
I will anyway use it quite a bit :P.

To clear,
quotes by me,

Yeah, just thought the i386 of Xpcli would be smaller.

Obviously mixing quite a few things there, xp pe (recovery), and normal (small) XP.

/fat mkfs , ???cool,

Yeah, had seen that Fat option. Had seen it, then thought um, maybe not usefull in this context, and was a bit weary of inadvertantly using it on a real drive. Then I forgot about it.

Ok, cool. Chenall, many thanks for the tool :).
&both, for the batches.
Also, about the subdirs, couldn't we root to (fd1) subdir and then copy the subdir files from cdrom?
(And @wonko thanks btw for the tips on last post.)

#42 steve6375

steve6375

    Platinum Member

  • Developer
  • 7186 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films,guitars, www.easy2boot.com
  •  
    United Kingdom

Posted 18 February 2012 - 01:36 PM

Previous post copies ALL of CD to fd1 including subdirs.

#43 betrand

betrand

    Frequent Member

  • Advanced user
  • 467 posts
  •  
    France

Posted 18 February 2012 - 01:39 PM

Previous post copies ALL of CD to fd1 including subdirs.

Doh!
:)

#44 steve6375

steve6375

    Platinum Member

  • Developer
  • 7186 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films,guitars, www.easy2boot.com
  •  
    United Kingdom

Posted 18 February 2012 - 09:57 PM

Please see end of this Tutorial. I have made an ISO and tested it and it seems to work fine if you use this method.
http://www.rmprepusb...makegrub4dosiso

#45 steve6375

steve6375

    Platinum Member

  • Developer
  • 7186 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films,guitars, www.easy2boot.com
  •  
    United Kingdom

Posted 19 February 2012 - 04:47 PM

There was a bug in the listing on the Tutorial web page which is now fixed. I changed %FD%%cd% to %FD%%%CD% as %% in a grub4dos batch file gets translated to a single % (but not in a grub4dos menu!). If you use the latest grldr release from chenall it can copy more files than previous versions (but still hangs when doing an i386 CD!).

#46 betrand

betrand

    Frequent Member

  • Advanced user
  • 467 posts
  •  
    France

Posted 29 March 2012 - 04:17 PM

Hi,

Finally I got round to testing this. The reason I didn't before was I was using an I think earlier version of Grub4dos Fat. I think earlier,
anyway different as it was smaller, and I got errors. So I had thought you guys were doing something I wasn't.
I came back to it recently, finding the right file too ;), and finally testing.

But, enventhough the files appear on fd1 ok, booted from an MsDos7.1 fd0,
once I try to run a program, pkunzip for example, I get a "general failure reading drive B",
(abort, retry, fail) and "access denied".
Fat created a Fat12, I think.
Might this be the problem, should I use a DOS which runs on Fat12?

Thanks.



I tried in Qemu btw. Also, "Access denied", and "General failure", but the files still appear afterwards. (after "abort")

#47 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 15176 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 29 March 2012 - 04:28 PM

As ALWAYS. good ideas would be:
  • post links to the EXACT versions of the programs you are using
  • describe ACCURATELY your setup
  • describe IN DETAIL what you attempted doing, WHAT you expected to happen, WHAT happened INSTEAD
http://homepage.ntlworld.com./jonathan.deboynepollard/FGA/problem-report-standard-litany.html

JFYI, Any DOS is able to read FAT12.

:cheers:
Wonko

#48 betrand

betrand

    Frequent Member

  • Advanced user
  • 467 posts
  •  
    France

Posted 29 March 2012 - 04:55 PM

Ok thanks.

My bad, it was just a matter of playing around with the (md) size. I think I'd made it too small.

I (now I've got correct version, and a bit of time) am trying the 4 batches.
The fat is grubutils-2011-06-27.zip,
and Qemu 0.9.0.
Setup is an Iso booting grldr, with a Dos image and the fat tool and batches.

Working now. It's cool.


Cheers.

#49 steve6375

steve6375

    Platinum Member

  • Developer
  • 7186 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films,guitars, www.easy2boot.com
  •  
    United Kingdom

Posted 29 March 2012 - 05:11 PM

RMPrepUSB latest Beta has (very recent) grub4dos install button and Test using QEMU button and allows you too easily make and test it. :rolleyes:
Exact versions etc are all linked in the tutorial.

#50 betrand

betrand

    Frequent Member

  • Advanced user
  • 467 posts
  •  
    France

Posted 29 March 2012 - 06:24 PM

Ok, thanks Steve.
I'd read the tutorial a few weeks ago. Nice (nice addition, too:)).
Wassn't there a trainling dash in makegrub4dosiso batch?
The source folder I think. I had deleted a "" and it processed.
But I didn't get a iso though. But I didn't try that much..
Probably I need to

RMPrepUSB latest Beta has (very recent) grub4dos install button and Test using QEMU button and allows you too easily make and test it.


Did you want my mkisofs command too?

mkisofs -v -iso-level 4 -N -D -d -joliet-long -volid "Grldr" -A GRLDR/MKISOFS -sysid "Win32" -b grldr -no-emul-boot -boot-load-seg 0x7C0 -boot-load-size 4 -o "grldr.iso" "folder"






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users