OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Apr 18, 2024 12:16 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: How do 32-bit POSIX compliant systems access files > 4GB?
PostPosted: Sun Nov 25, 2007 4:53 am 
Offline
Member
Member
User avatar

Joined: Tue Jul 10, 2007 5:27 am
Posts: 2935
Location: York, United Kingdom
Title really explains it all: I've been pondering this for a while.

The read/write functions defined by POSIX are all syscalls, and as such all the parameters *have* to be 32bits on a 32 bit system, right? So how do you access past 4GB of a file by using the standard read/write syscalls?

_________________
Horizon - a framework and language for SAS-OS development
Project 'Pedigree'
Practical x86 OSDev tutorials


Top
 Profile  
 
 Post subject:
PostPosted: Sun Nov 25, 2007 6:34 am 
Offline
Member
Member

Joined: Mon Apr 09, 2007 12:10 pm
Posts: 775
Location: London, UK
Single Unix specification Large file support defines a file offset to be of 'extended signed integral type' i.e. signed long long int. This means the standard functions like fseek should support LFS by standard in a c library that supports it. How this translates into syscalls is up to you. I suppose functions in a small file only c library could call one syscall, and those in a large file one could call a different syscall (e.g. fstat/fstat64 in glibc). How you pass a 64-bit value to a syscall is a question you probably should have already answered, e.g. use EAX:EDX or use EAX to point to a 64 bit value in memory.

Regards,
John.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Nov 25, 2007 2:51 pm 
Offline
Member
Member
User avatar

Joined: Tue Oct 17, 2006 9:29 pm
Posts: 2426
Location: Canada
The Wikipedia article on LFS seems to be a good resource as well.. :)

http://en.wikipedia.org/wiki/Large_file_support

_________________
Image
Twitter: @canadianbryan. Award by smcerm, I stole it. Original was larger.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot], Google [Bot], SemrushBot [Bot] and 273 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group