#9 Formalize 64-bit hard drive file I/O

closed
nobody
None
5
2002-09-28
2001-12-22
No

I recently tested BasiliskII with 64-bit hard drive file I/O and it appears to work properly :)!
I'm trying to repair a friend's hard drive, but her image file is 2.5GB. Default compiles of
BasiliskII said that the file was too large, but adding "-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
-D_LARGEFILE64_SOURCE" to the DEFS line in the generated src/Unix/Makefile did the trick for now in
addition to the following change:

Index: sys_unix.cpp

RCS file: /cvs/BasiliskII/src/Unix/sys_unix.cpp,v
retrieving revision 1.10
diff -u -3 -p -r1.10 sys_unix.cpp
--- sys_unix.cpp 31 Jul 2001 14:10:35 -0000 1.10
+++ sys_unix.cpp 22 Dec 2001 16:55:39 -0000
@@ -274,9 +274,9 @@ void *Sys_open(const char *name, bool re

// Open file/device
#if defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__)
- int fd = open(name, (read_only ? O_RDONLY : O_RDWR) | (is_cdrom ? O_NONBLOCK : 0));
+ int fd = open64(name, (read_only ? O_RDONLY : O_RDWR) | (is_cdrom ? O_NONBLOCK : 0));
#else
int fd = open(name, read_only ? O_RDONLY : O_RDWR);

Could BasiliskII be verified as 64-bit safe, and this option added to the configure script? So
far, it seems to be working great :-)!

Discussion

  • Steven Lawrance

    Steven Lawrance - 2001-12-22

    Logged In: YES
    user_id=54130

    And silly am I, as I forgot to say what environment I was in ;-). I'm using the latest Mandrake Cooker
    (12/20/2001) and the latest BasiliskII CVS (12/22/01). Compiling with standard options. My system is a dual
    Pentium I 233/MMX with 192MB of RAM.

     
  • Gwenole Beauchesne

    Logged In: YES
    user_id=54722

    It is enough to add -D_LARGEFILE_SOURCE
    -D_FILE_OFFSET_BITS=64 to the DEFS flags to have large file
    support. sys_unix.cpp doesn't require any patch since AFAIK,
    with the above two defines, offsets are all 64-bits and
    open/read/et al functions are 64-bit aware.

    Bye,
    Gwenol.

     
  • Gwenole Beauchesne

    Logged In: YES
    user_id=54722

    New packages with LFS will be uploaded for Mandrake Linux
    soon. Check your mirrors. ;-)

    Bye,
    Gwenol.

    --- BasiliskII-0.9.JIT/src/Unix/configure.in.LFS Thu Dec 20 22:43:44 2001
    +++ BasiliskII-0.9.JIT/src/Unix/configure.in Thu Dec 27 13:34:10 2001
    @@ -5,6 +5,10 @@
    AC_PREREQ(2.12)
    AC_CONFIG_HEADER(config.h)

    +dnl These defines are necessary to get 64-bit file size
    support.
    +AC_DEFINE(_USE_LARGEFILE_SOURCE, 1, [Get more functions for
    correct standard I/O])
    +AC_DEFINE(_FILE_OFFSET_BITS, 64, [Get 64-bit file size
    support])
    +
    dnl Video options.
    AC_ARG_ENABLE(xf86-dga, [ --enable-xf86-dga use
    the XFree86 DGA extension [default=yes]],
    [WANT_XF86_DGA=$enableval], [WANT_XF86_DGA=yes])
    AC_ARG_ENABLE(xf86-vidmode, [ --enable-xf86-vidmode use
    the XFree86 VidMode extension [default=yes]],
    [WANT_XF86_VIDMODE=$enableval], [WANT_XF86_VIDMODE=yes])

     
  • Steven Lawrance

    Steven Lawrance - 2001-12-31

    Logged In: YES
    user_id=54130

    Thanks :-)!!

     
  • Gwenole Beauchesne

    Logged In: YES
    user_id=54722

    Large File Support was recently extended to other platforms
    than Linux. Please check current CVS sources and fill in a
    bug if this still doesn't work for your platform.

     
  • Gwenole Beauchesne

    • status: open --> closed
     

Log in to post a comment.