English Amiga Board Amiga Lore


Go Back   English Amiga Board > Support > support.WinUAE

 
 
Thread Tools
Old 30 December 2016, 05:12   #1
rsn8887
Registered User
rsn8887's Avatar
 
Join Date: Oct 2006
Location: USA
Posts: 727
hdf "surfaces" setting? What does it do?

This might be a quickie for Toni (thanks in advance )

I created a 400 MB hdf a decade ago and used it forever with "surfaces=1."

Just to try it, I just set surfaces to 4... and it still just works!

Is it ok to use "surfaces = 4" for all my hdf, regardless of size? This would mean that both small and large (4Gb) hdf would work without ever having to change any setting.

I noticed that on large hdf > 1 GB, normally, I would have to set surfaces manually to 2, and if the size is >2 GB I would have to set it to 4.

I would like to keep it always at 4 if that is ok from the emulator's side?
rsn8887 is offline  
AdSense AdSense  
Old 30 December 2016, 08:14   #2
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 42
Posts: 19,542
It is filesystem that decides what it does with geometry information. Some may ignore it after formatting, some may not.
Toni Wilen is online now  
Old 30 December 2016, 09:24   #3
rsn8887
Registered User
rsn8887's Avatar
 
Join Date: Oct 2006
Location: USA
Posts: 727
Ah interesting.

So when the hdf is created in WinUAE, which geometry is used? Shall I set the parameters (surfaces etc.) before I click "create"?

Is that what determines the geometry of my newly created hdf? It is unclear since the create button is in a different box. Does it make use of those values from the box above?

It is a bit hard to tell since the dialog seems to really want to reset to surfaces=1 a lot. For example, I set it to surfaces = 4. Enter 2000 in the hdf size box, click create hdf. And then it resets to surfaces = 1. Did I just create a HD with surfaces = 1 or one with surfaces = 4?

Last edited by rsn8887; 30 December 2016 at 09:30.
rsn8887 is offline  
Old 30 December 2016, 10:47   #4
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 42
Posts: 19,542
Most important part: Geometry does not exist, it is virtual. (Except if HD uses older protocol than SCSI or IDE.)

Geometry only defines "internal" size of HDF. It does not affect physical case. The rest is left for driver/filesystem. SCSI/IDE/UAE controllers always use LBA (logical block address = 1:1 addressing that counts number of blocks from start of drive). IDE can also use CHS addressing but it is also virtual.

(That didn't help much, didn't it? Someone can try to explain CHS geometry better than me..)

EDIT: If you change geometry you also change size of whole HDF that driver sees (including making it larger than actual HDF is. Which is not good idea). Filesystem may or may not care about that. Size numbers shown in HDF panel status bar: it shows physical size and logical size (=size calculated from geometry).
Toni Wilen is online now  
Old 30 December 2016, 11:40   #5
meynaf
68k wisdom
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon (France)
Age: 44
Posts: 2,370
Quote:
Originally Posted by Toni Wilen View Post
(That didn't help much, didn't it? Someone can try to explain CHS geometry better than me..)
I will try. CHS stands for Cylinders/Heads/Sectors. Cylinders are also called Tracks, Heads and Surfaces are the same.

Hard drives are like big floppies.

On a floppy disk you have 2 Heads, 80 Cylinders, 11 Sectors. On hard drives you have more than 2 heads (usually something like 16), more sectors, and a lot more cylinders. However if we had 1 Head, 160 Cyls, 11 Sec, the floppy disk's size would remain the same.

In modern drives this geometry is hidden and we only see the final size. But AmigaOS still uses these values, so we have to provide some that end up giving the real size.
meynaf is offline  
Old 30 December 2016, 17:57   #6
sigma63
Registered User

 
Join Date: Oct 2014
Location: Berlin
Posts: 79
Quote:
Originally Posted by meynaf View Post
Cylinders are also called Tracks
I don't agree on that. I think, Tracks = Cylinders * Heads

(so you are right if you only have one Head )

But, don't loose your Head
sigma63 is offline  
Old 30 December 2016, 19:13   #7
meynaf
68k wisdom
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon (France)
Age: 44
Posts: 2,370
Quote:
Originally Posted by sigma63 View Post
I don't agree on that. I think, Tracks = Cylinders * Heads
That's very possible ; names may vary among people. Let's just call them Cylinders to be sure
meynaf is offline  
Old 30 December 2016, 20:02   #8
thomas
Registered User
thomas's Avatar
 
Join Date: Jan 2002
Location: Germany
Posts: 5,508
Quote:
Originally Posted by meynaf View Post
Cylinders are also called Tracks
Yes and no.

Actually it is like this: harddisks are made of several disks, each disk has two surfaces and each surface needs a head to be accessed.

Now the surfaces are devided into tracks and the collection of the same track on all surfaces makes up a cylinder.

For example on a floppy disk, track #5 on the upper side plus track #5 on the lower side make up cylinder #5.

That said, the whole geometry is irrelevant nowadays. All you need to know is

"sectors" = sectors per track
"heads" = tracks per cylinder
sectors * heads = sectors per cylinder
sectors per cyliner * cylinders = total number of sectors
total number of sectors * sectors size = capacity of the harddisk

While geometry is irrelevant, the number of sectors per cylinder still matters because partitions can only be defined on cylinder boundaries.

And if you make a clever selection for the cylinder size you can automatically align partitions for example on megabyte boundaries (which might be useful for SSDs).
thomas is offline  
Old 30 December 2016, 20:20   #9
rsn8887
Registered User
rsn8887's Avatar
 
Join Date: Oct 2006
Location: USA
Posts: 727
If geometry determines the size, why is the geometry the same when I create a 100 MB or 500 MB HDF? It is always 32:1:2:512 and that works until I get into the >1GB regime.

According to all the explanations above, shouldn't I have to meticulously edit the geometry depending on my desired HDF size? This would be quite a chore. I am glad I don't have to do that to come up with the exact numbers everytime down to the byte.

But I am still a bit lost.

Is there a parameter that UAE adjusts automatically to make the total bytes come out right, even in the "standard" geometry 32:1:2:512?
rsn8887 is offline  
Old 30 December 2016, 23:31   #10
thomas
Registered User
thomas's Avatar
 
Join Date: Jan 2002
Location: Germany
Posts: 5,508
Reserved is not part of the geometry.

The capacity is defined as heads * sectors * cylinders. You can only specify heads and sectors in the config. The number of cylinders is derived from the file size.
thomas is offline  
Old 31 December 2016, 00:23   #11
rsn8887
Registered User
rsn8887's Avatar
 
Join Date: Oct 2006
Location: USA
Posts: 727
Ah now it starts to make sense. Thank you thomas.

I am asking because I am trying to understand why .hdf files >2 Gb don't seem to work in UAE4ALL/UAE4Arm. Even if I enter the geometry correctly, large drives always show up as NDOS. When I try to format them, they show up fine, but anytime I try to copy something over I get some DOS Error. Also when I reset the emu, they go back to showing NDOS.

I haven't even tested 2 GB hdf's fully, but a quick test showed that I can at least copy something to them.

I suspect UAE4ALL is based on some old UAE code that was buggy when dealing with large hdf files.

I compared the cfgfile.cpp routines and there have been a lot of changes comparing UAE4ALL to WinUAE. I hope it is a simple fix to that file that will make 4GB hdf work in UAE4ALL. But so far I couldn't see anything.

If anybody wants to take a look my source repo for UAE4ALL Vita is here:

www.github.com/rsn8887/uae4all2
rsn8887 is offline  
Old 31 December 2016, 08:48   #12
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 42
Posts: 19,542
2G limit comes from 32-bit filehandling support. (hardfile.c is really old and very basic)

- C-library fseek() and friends support only up to 2G. They need to be switched to 64-bit versions.
- Normal CMD_READ/CMD_WRITE can do up to 4G-1.
Toni Wilen is online now  
Old 31 December 2016, 18:34   #13
rsn8887
Registered User
rsn8887's Avatar
 
Join Date: Oct 2006
Location: USA
Posts: 727
Ah awesome thanks for looking into this. It would have taken my ages to figure that out. How lame and ancient is the c standard library it is embarrassing. That explains it then. After some more testing my 2000 MB hdfs work just fine in UAE4All2. And anything larger than 2 GB won't work unless I or somebody else fixes that code.

I suspect the hdf code will also become much slower when it uses the 64-bit addressing. It is already quite slow on the vita. But it could be limited by the access speed of the memory card, too.
rsn8887 is offline  
Old 31 December 2016, 23:31   #14
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 42
Posts: 19,542
Switching to >2G capable file access functions won't make it any slower. File access is far from speed critical.
Toni Wilen is online now  
Old 01 January 2017, 01:18   #15
rsn8887
Registered User
rsn8887's Avatar
 
Join Date: Oct 2006
Location: USA
Posts: 727
I see that makes sense, so it is just a matter of adapting the code to use the 64 bit addressing then.
rsn8887 is offline  
AdSense AdSense  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
"Voices8" 8 Channel Soundtracker "DemoSongI" song - "This is the Amiga with 8 Voices" DemosongIHunter request.Music 40 13 April 2017 05:06
Auto-setting chipset to "original" on AGA startup MethodGit Coders. General 16 11 March 2016 17:47
How do you make a filter setting "stick" to a configuration? ral-clan support.WinUAE 0 11 September 2011 20:51
OS3.9 graphics corruption when setting changed to put icons in "Other Memory" StevenJGore support.Apps 3 09 September 2008 18:22
"HDF emulation" for large single-file binaries (e. g. demos) andreas request.UAE Wishlist 2 11 June 2007 01:26

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 08:37.


Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Page generated in 0.17938 seconds with 11 queries