sl@0
|
1 |
/*
|
sl@0
|
2 |
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
sl@0
|
3 |
* All rights reserved.
|
sl@0
|
4 |
* This component and the accompanying materials are made available
|
sl@0
|
5 |
* under the terms of "Eclipse Public License v1.0"
|
sl@0
|
6 |
* which accompanies this distribution, and is available
|
sl@0
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
sl@0
|
8 |
*
|
sl@0
|
9 |
* Initial Contributors:
|
sl@0
|
10 |
* Nokia Corporation - initial contribution.
|
sl@0
|
11 |
*
|
sl@0
|
12 |
* Contributors:
|
sl@0
|
13 |
*
|
sl@0
|
14 |
* Description:
|
sl@0
|
15 |
*
|
sl@0
|
16 |
*/
|
sl@0
|
17 |
|
sl@0
|
18 |
|
sl@0
|
19 |
Description:
|
sl@0
|
20 |
-----------------------------------
|
sl@0
|
21 |
|
sl@0
|
22 |
The "win_drive" file system extension for the emulator allows you to attach Windows device
|
sl@0
|
23 |
(that supports CreateFile/ReadFile/WriteFile operations) to the Symbian OS emulator as the emulated drive.
|
sl@0
|
24 |
For example, windows HDD partition, removable drive or a file can be treated by the emulator as "media" mapped
|
sl@0
|
25 |
on some emulator's drive letter.
|
sl@0
|
26 |
|
sl@0
|
27 |
How it works:
|
sl@0
|
28 |
-----------------------------------
|
sl@0
|
29 |
|
sl@0
|
30 |
This extension is installed as a primary one and hooks all emulators media driver's operations redirecting them to
|
sl@0
|
31 |
appropriate windows file IO API.
|
sl@0
|
32 |
|
sl@0
|
33 |
Why:
|
sl@0
|
34 |
-----------------------------------
|
sl@0
|
35 |
|
sl@0
|
36 |
Existing Symbian OS windows emulator has a quite limited support for its drives:
|
sl@0
|
37 |
|
sl@0
|
38 |
- emulator's drives suport can be implemented within media driver stacks (like mmc) which is not
|
sl@0
|
39 |
very easy to configure properly. Moreover, using whole driver stacks is not always required and
|
sl@0
|
40 |
slows down emulator filesystems.
|
sl@0
|
41 |
|
sl@0
|
42 |
- it is not always easy to attach filesystem image file to the emulator and it's impossible make it
|
sl@0
|
43 |
to use physical drive (USB drive for example)
|
sl@0
|
44 |
|
sl@0
|
45 |
- emulated MMC drives can't be bigger than 1G or something, which doesn't make work with FAT32 easy.
|
sl@0
|
46 |
|
sl@0
|
47 |
|
sl@0
|
48 |
How to use:
|
sl@0
|
49 |
-----------------------------------
|
sl@0
|
50 |
1. make sure that the extension file "win_drive.fxt" is present in the emulator's "Z:\" drive directory:
|
sl@0
|
51 |
"\epoc32\release\wins\udeb\" or "\epoc32\release\winscw\udeb\" or "...\urel\", depending on what platform
|
sl@0
|
52 |
and release you are using.
|
sl@0
|
53 |
|
sl@0
|
54 |
2. copy "win_drive.ini" configuration file to: "\epoc32\data\"
|
sl@0
|
55 |
3. edit this file to set up emulated drive size, location etc. See inside.
|
sl@0
|
56 |
|
sl@0
|
57 |
4. Tell the emulator to install "win_drive.fxt" extension to the emulator's drive you are going to use.
|
sl@0
|
58 |
to do this edit appropritae "estart.txt" file, which can be, for example, here: \epoc32\release\wins\udeb\z\sys\DATA\estart.txt
|
sl@0
|
59 |
If there is no such a file, copy the default one from "\emulator\wins\estart\estart.txt"
|
sl@0
|
60 |
|
sl@0
|
61 |
Example:
|
sl@0
|
62 |
|
sl@0
|
63 |
[....]
|
sl@0
|
64 |
#X: 1 EFAT32 FAT 0 FS_FORMAT_CORRUPT #<--- previous commented out line
|
sl@0
|
65 |
X: 1 EFAT32 FAT win_drive FS_FORMAT_CORRUPT #<--- drive "X:" now has "win_drive" primary extension
|
sl@0
|
66 |
[....]
|
sl@0
|
67 |
|
sl@0
|
68 |
5. run the emulator, its drive "X:" will be redirected to the device you have set up in the "win_drive.ini" file.
|
sl@0
|
69 |
|
sl@0
|
70 |
|
sl@0
|
71 |
|
sl@0
|
72 |
Configuration examples:
|
sl@0
|
73 |
-----------------------------------
|
sl@0
|
74 |
|
sl@0
|
75 |
1. Windows drive F: is a USB cardreader with the SD card you want to use as the emulator's "X:" FAT drive.
|
sl@0
|
76 |
Minimal settings in "win_drive.ini" for this case:
|
sl@0
|
77 |
|
sl@0
|
78 |
=========================
|
sl@0
|
79 |
[Drive_X]
|
sl@0
|
80 |
DeviceName=\\.\F:
|
sl@0
|
81 |
BytesPerSector=0 ;or just comment it out
|
sl@0
|
82 |
MediaSizeInSectors=0 ;or just comment it out
|
sl@0
|
83 |
=========================
|
sl@0
|
84 |
|
sl@0
|
85 |
2. You have a spare partition that has "Z:" windows drive letter and you want to use a part of it (to say 1G) as the emulator's "X:" FAT drive.
|
sl@0
|
86 |
Minimal settings in "win_drive.ini" for this case:
|
sl@0
|
87 |
|
sl@0
|
88 |
=========================
|
sl@0
|
89 |
[Drive_X]
|
sl@0
|
90 |
DeviceName=\\.\Z:
|
sl@0
|
91 |
MediaSizeInSectors=2097152
|
sl@0
|
92 |
=========================
|
sl@0
|
93 |
|
sl@0
|
94 |
|
sl@0
|
95 |
3. You want to use 8G file as the emulator's "X:" FAT drive. The file doesn't exist.
|
sl@0
|
96 |
|
sl@0
|
97 |
Minimal settings in "win_drive.ini" for this case:
|
sl@0
|
98 |
=========================
|
sl@0
|
99 |
[Drive_X]
|
sl@0
|
100 |
DeviceName=c:\MyDir\MyImageFile8G.img
|
sl@0
|
101 |
MediaSizeInSectors=16777216
|
sl@0
|
102 |
=========================
|
sl@0
|
103 |
|
sl@0
|
104 |
|
sl@0
|
105 |
4. You have a FAT volume image file and want to attach it as as the emulator's "X:" FAT drive. You also want to have it read-only.
|
sl@0
|
106 |
|
sl@0
|
107 |
Minimal settings in "win_drive.ini" for this case:
|
sl@0
|
108 |
=========================
|
sl@0
|
109 |
[Drive_X]
|
sl@0
|
110 |
DeviceName=c:\MyDir\MyImageFile.img
|
sl@0
|
111 |
MediaSizeInSectors=0 ;or just comment it out
|
sl@0
|
112 |
ReadOnly = 1;
|
sl@0
|
113 |
=========================
|
sl@0
|
114 |
|
sl@0
|
115 |
|
sl@0
|
116 |
Troubleshooting:
|
sl@0
|
117 |
-----------------------------------
|
sl@0
|
118 |
See "epocwind.out" file if something is going wrong.
|
sl@0
|
119 |
|
sl@0
|
120 |
|
sl@0
|
121 |
|
sl@0
|
122 |
Drawbacks:
|
sl@0
|
123 |
-----------------------------------
|
sl@0
|
124 |
|
sl@0
|
125 |
- you can't use this extension if the emulator's drive alredy uses primary extension (see estart.txt).
|
sl@0
|
126 |
- some dodgy tests can fail, for example, those, that dismount the file system and forget to store and mount all its extensions
|
sl@0
|
127 |
include primary.
|
sl@0
|
128 |
- Some methods from media driver are not overriden yet and just go directly to the original media driver; it can be confusing.
|
sl@0
|
129 |
|
sl@0
|
130 |
|
sl@0
|
131 |
|
sl@0
|
132 |
|
sl@0
|
133 |
|
sl@0
|
134 |
|
sl@0
|
135 |
|
sl@0
|
136 |
|
sl@0
|
137 |
|
sl@0
|
138 |
|
sl@0
|
139 |
|