Pages

Sabtu, 27 Agustus 2011

Sistem Berkas (File System)

Sistem Berkas
Semua aplikasi komputer butuh menyimpan dan mengambil informasi. Ketika sebuah
proses sedang berjalan, proses tersebut menyimpan sejumlah informasi yang terbatas,
dibatasi oleh ukuran alamat virtual. Untuk beberapa aplikasi, ukuran ini cukup, namun
untuk lainnya terlalu kecil.
Masalah berikutnya adalah apabila proses tersebut berhenti maka informasinya hilang.
Padahal ada beberapa informasi yang penting dan harus bertahan beberapa waktu bahkan
selamanya.
Adapun masalah ketiga yaitu sangatlah perlu terkadang untuk lebih dari satu proses
mengakses informasi secara berbarengan. Untuk memecahkan masalah ini, informasi
tersebut harus dapat berdiri sendiri tanpa tergantung dengan sebuah proses.
Pada akhirnya kita memiliki masalah-masalah yang cukup signifikan dan penting untuk
dicari solusinya.
Pertama kita harus dapat menyimpan informasi dengan ukuran yang besar. Kedua,
informasi harus tetap ketika proses berhenti. Ketiga, informasi harus dapat diakses oleh
lebih dari satu proses secara bersamaan. Solusi dari ketiga masalah diatas adalah sesuatu
yang disebut berkas.
Berkas adalah sebuah unit tempat menyimpan informasi. Berkas ini dapat diakses lebih
dari satu proses, dapat dibaca, dan bahkan menulis yang baru. Informasi yang disimpan
dalam berkas harus persisten, dalam artian tidak hilang sewaktu proses berhenti. Berkasberkas
ini diatur oleh sistem operasi, bagaimana strukturnya, namanya, aksesnya,
penggunaannya, perlindungannya, dan implementasinya. Bagian dari sistem operasi yang
mengatur masalah-masalah ini disebut sistem berkas.
Untuk kebanyakan pengguna, sistem berkas adalah aspek yang paling terlihat dari sebuah
sistem operasi. Dia menyediakan mekanisme untuk penyimpanan online dan akses ke
data dan program. Sistem berkas terbagi menjadi dua bagian yang jelas; koleksi berkas
(masing-masing menyimpan data yang berkaitan) dan struktur direktori (mengatur dan
menyediakan informasi mengenai semua berkas yang berada di sistem). Sekarang
marilah kita memperdalam konsep dari berkas tersebut.

1. Konsep Berkas
Berkas adalah sebuah koleksi informasi berkaitan yang diberi nama dan disimpan di
dalam secondary storage.
Biasanya sebuah berkas merepresentasikan data atau program. Adapun jenis-jenis dari
berkas:
• Text file: yaitu urutan dari karakter-karakter yang diatur menjadi barisan dan mungkin
halaman.
• Source file: yaitu urutan dari berbagai subroutine dan fungsi yang masing-masing
kemudian diatur sebagai deklarasi-deklarasi diikuti oleh pernyataan-pernyataan yang
dapat diexecute.
• Object file: yaitu urutan dari byte-byte yang diatur menjadi blok-blok yang dapat
dipahami oleh penghubung system.
• Executable file: adalah kumpulan dari bagian-bagian kode yang dapat dibawa ke
memori dan dijalankan oleh loader.


2. Atribut berkas
Selain nama dan data, sebuah berkas dikaitkan dengan informasi-informasi tertentu yang
juga penting untuk dilihat pengguna, seperti kapan berkas itu dibuat, ukuran berkas, dan
lain-lain. Kita akan sebut informasi-informasi ekstra ini atribut. Setiap sistem mempunyai
sistem atribusi yang berbeda-beda, namun pada dasarnya memiliki atribut-atribut dasar
seperti berikut ini:
a. Nama: nama berkas simbolik ini adalah informasi satu-satunya yang disimpan
dalam format yang dapat dibaca oleh pengguna.
b. Identifier: tanda unik ini yang biasanya merupakan sebuah angka, mengenali
berkas didalam sebuah sistem berkas; tidak dapat dibaca oleh pengguna.
c. Jenis: informasi ini diperlukan untuk sistem-sistem yang mendukung jenis berkas
yang berbeda.
d. Lokasi: informasi ini adalah sebuah penunjuk pada sebuah device dan pada lokasi
berkas pada device tersebut.
e. Ukuran: ukuran dari sebuah berkas (dalam bytes, words, atau blocks) dan
mungkin ukuran maksimum dimasukkan dalam atribut ini juga.

f. Proteksi: informasi yang menentukan siapa yang dapat melakukan read, write,
execute, dan lainnya.
g. Waktu dan identifikasi pengguna: informasi ini dapat disimpan untuk pembuatan
berkas, modifikasi terakhir, dan penggunaan terakhir. Data-data ini dapat berguna
untuk proteksi, keamanan, dan monitoring penggunaan.

h. Jenis Berkas
Salah satu atribut dari sebuah berkas yang cukup penting adalah jenis berkas. Saat kita
mendesain sebuah sistem berkas, kita perlu mempertimbangkan bagaimana operating
sistem akan mengenali berkas-berkas dengan jenis yang berbeda. Apabila sistem operasi
dapat mengenali, maka menjalankan berkas tersebut bukan suatu masalah.
Seperti contohnya, apabila kita hendak mengeprint bentuk binary-object dari sebuah
program, yang didapat biasanya adalah sampah, namun hal ini dapat dihindari apabila
sistem operasi telah diberitahu akan adanya jenis berkas tersebut.
Cara yang paling umum untuk mengimplementasikan jenis berkas tersebut adalah dengan
memasukkan jenis berkas tersebut ke dalam nama berkas. Nama berkas dibagi menjadi
dua bagian. Bagian pertama adalah nama dari berkas tersebut, dan yang kedua, atau biasa
disebut extention adalah jenis dari berkas tersebut. Kedua nama ini biasanya dipisahkan
dengan tanda ’.’, contoh: berkas.txt.


4. Operasi Berkas
Fungsi dari berkas adalah untuk menyimpan data dan mengizinkan kita membacanya.
Dalam proses ini ada beberapa operasi yang dapat dilakukan berkas. Adapun operasioperasi
dasar yang dilakukan berkas, yaitu:
a. Membuat Berkas (Create):
Kita perlu dua langkah untuk membuat suatu berkas. Pertama, kita harus temukan
tempat didalam sistem berkas. Kedua, sebuah entri untuk berkas yang baru harus
dibuat dalam direktori. Entri dalam direktori tersebut merekam nama dari berkas
dan lokasinya dalam sistem berkas.
b. Menulis sebuah berkas (Write): Untuk menulis sebuah berkas, kita membuat sebuah system call yang
menyebutkan nama berkas dan informasi yang akan di-nulis kedalam berkas.
c. Membaca Sebuah berkas (Read):
Untuk membaca sebuah berkas menggunakan sebuah system call yang menyebut
nama berkas yang dimana dalam blok memori berikutnya dari sebuah berkas
harus diposisikan.
d. Memposisikan Sebuah Berkas (Reposition):
Direktori dicari untuk entri yang sesuai dan current-file-position diberi sebuah
nilai. Operasi ini di dalam berkas tidak perlu melibatkan I/O, selain itu juga
diketahui sebagai file seek.
e. Menghapus Berkas (Delete):
Untuk menghapus sebuah berkas kita mencari dalam direktori untuk nama berkas
tersebut. Setelah ditemukan, kita melepaskan semua spasi berkas sehingga dapat
digunakan kembali oleh berkas-berkas lainnya dan menghapus entry direktori.
f. Menghapus Sebagian Isi Berkas (Truncate):
User mungkin mau menghapus isi dari sebuah berkas, namun menyimpan
atributnya. Daripada memaksa pengguna untuk menghapus berkas tersebut dan
membuatnya kembali, fungsi ini tidak akan mengganti atribut, kecuali panjang
berkas dan mendefinisikan ulang panjang berkas tersebut menjadi nol.
Keenam operasi diatas merupakan operasi-operasi dasar dari sebuah berkas yang
nantinya dapat dikombinasikan untuk membentuk operasi-operasi baru lainnya.
Contohnya apabila kita ingin menyalin sebuah berkas, maka kita memakai operasi create
untuk membuat berkas baru, read untuk membaca berkas yang lama, dan write untuk
menulisnya pada berkas yang baru.

5. Struktur Berkas
Berkas dapat di struktur dalam beberapa cara. Cara yang pertama adalah sebuah urutan
bytes yang tidak terstruktur. Akibatnya sistem operasi tidak tahu atau peduli apa yang ada
dalam berkas, yang dilihatnya hanya bytes. Ini menyediakan fleksibilitas yang
maksimum. User dapat menaruh apapun yang mereka mau dalam berkas, dan sistem
operasi tidak membantu, namun tidak juga menghalangi.
Cara berikutnya, adalah dengan record sequence. Dalam model ini, sebuah berkas adalah
sebuah urutan dari rekaman-rekaman yang telah ditentukan panjangnya, masing-masing
dengan beberapa struktur internal. Artinya adalah bahwa sebuah operasi read
membalikan sebuah rekaman dan operasi write menimpa atau menambahkan suatu
rekaman.
Struktur berkas yang ketiga, adalah menggunakan sebuah tree. Dalam struktur ini sebuah
berkas terdiri dari sebuah tree dari rekaman-rekaman tidak perlu dalam panjang yang
sama, tetapi masing-masing memiliki sebuah field key dalam posisi yang telah ditetapkan
dalam rekaman tersebut. Tree ini disort dalam field key dan mengizinkan pencarian yang
cepat untuk sebuah key tertentu.


6. Metode Akses
Berkas menyimpan informasi. Apabila sedang digunakan informasi ini harus diakses dan
dibaca melalui memori komputer. Informasi dalam berkas dapat diakses dengan beberapa
cara. Berikut adalah beberapa caranya:
a. Akses Sekuensial
Akses ini merupakan yang paling sederhana dan paling umum digunakan.
Informasi di dalam berkas diproses secara berurutan. Sebagai contoh, editor dan
kompilator biasanya mengakses berkas dengan cara ini.
b. Akses Langsung
Metode berikutnya adalah akses langsung atau dapat disebut relative access.
Sebuah berkas dibuat dari rekaman-rekaman logical yang panjangnya sudah
ditentukan, yang mengizinkan program untuk membaca dan menulis rekaman
secara cepat tanpa urutan tertentu.


translate in English:

File System


All computer applications need to store and retrieve information. When a
the process is running, the process stores a limited amount of information,
limited by the size of the virtual address. For some applications, this size is sufficient, but
for the other too little.
The next problem is that if the process is stopped then the information is lost.
Though there is some important information and should persist for some time even
forever.
The third problem which is necessary sometimes to more than one process
access the information simultaneously. To solve this problem, information
must be able to stand alone without depending on a process.
In the end we have problems is significant and important for
sought solution.
First we must be able to store information with a large size. Second,
information must remain when the process stops. Third, information must be accessible by
more than one process simultaneously. The solution of the three above problems is something
called file.
The file is a unit of a place to store information. This file can be accessed more
from one process, readable, and even write new ones. The information stored
in the beam must be persistent, in a sense is not lost when the process stops. Berkasberkas
is governed by the operating system, how its structure, its name, its access,
use, protection, and implementation. Part of the operating system
manage these problems is called the file system.
For most users, the file system is the most visible aspect of a
operating system. He provides a mechanism for online storage and access to
data and programs. The file system is divided into two clear parts: a collection of files
(Each storing data related) and directory structure (set up and
provide information on all the files that exist in the system). Now
Let us deepen the concept of the file

1. File Concepts
The file is a collection of related information that is named and stored in
in secondary storage.
Usually a file representing data or programs. As for the types of
file:
• Text file: ie a sequence of characters that are arranged into rows and possible
page.
• Source files: the sequence of the various subroutines and functions that each
then set as the declarations followed by statements
can diexecute.
• Object files: the sequence of bytes are arranged into blocks that can be
understood by the connecting system.
• Executable file: is a collection of parts of code that can be taken to
memory and executed by the loader.


2. File attributes
In addition to names and data, a file is associated with certain information that
also important for users to see, such as when the file was created, file size, and
others. We will call this extra information attributes. Each system has
attribution system is different, but basically has the basic attributes
as follows:
a. Name: file name of this symbolic information is only stored
in a format readable by the user.
b. Identifier: This unique sign which is usually a number, identify
file within a file system; can not be read by the user.
c. Type: This information is required for systems that support this type of file
different.
d. Location: This information is a pointer to a device and the location
files on the device.
e. Size: the size of a file (in bytes, words, or blocks) and
The maximum size may be included in this attribute also

f. Protection: the information that determines who can read, write,
execute, and others.
g. Time and user identification: This information can be stored for the manufacture
files, last modification, and last use. These data can be useful
for protection, security, and monitoring usage.

3. File Types
One of the attributes of a file that's quite important is the type of file. When we
designing a filesystem, we need to consider how the operating
system will recognize files with a different kind. If the operating system
can recognize, then run the file is not a problem.
For example, if we want to print the form of a binary-object
program, which usually get is garbage, but this can be avoided if
operating system has been notified of the existence of the file type.
The most common way to implement the type of file is by
enter the type of file into the file name. The name of the file is divided into
two parts. The first part is the name of the file, and the second, or ordinary
called extension is a type of file. Both names are usually separated
with the sign '.', for example: berkas.txt.

4. File Operations
The function of the file is to store data and allow us to read it.
In this process there are some operations that can be done file. The operasioperasi
conducted basic file, namely:
a. Make File (Create):
We need two steps to create a file. First, we must find
place within the file system. Second, a new entry for the file that should be
created in the directory. The entries in the directory record the name of the file
and its location in the file system.
b. Writes a file (Write): To write a file, we create a system call that
name the file and the information will be writing into a file.
c. Reading a file (Read):
To read a file using a system call is called
filename where the next memory block from a file
should be positioned.
d. Positioning A File (reposition):
Searchable directory for the appropriate entry and current-file-position were given a
value. This operation is in the file need not involve I / O, but it also
known as a file seek.
e. Deleting Files (Delete):
To delete a file we are looking in the directory for file names
them. Once found, we release all files so spaces can be
reused by other files and delete the directory entry.
f. Removing Some Content Files (truncate):
Users may want to delete the contents of a file, but save
attributes. Rather than forcing the user to delete the file and
make it again, this function will not change the attributes, except the length
file and redefine the file to zero length.
The six operations are operations on the basis of a file
can later be combined to form other new operations.
For example if we want to copy a file, then we use the create operation
to create a new file, read the old files to read, and write to
write them on the new file.

5. File Structure
The file can be in the structure in several ways. The first way is a sequence
unstructured bytes. As a result, the operating system does not know or care what's
in the beam, which saw only the bytes. It provides flexibility
maximum. Users can put anything they want in the file, and the system
operation does not help, but do not also block.
The next way is to record sequences. In this model, a file is
a sequence of recordings that have been determined in length, respectively
with some internal structure. It means that a read operation
reversal of a write operation of recording and overwrite or add a
recordings.
The third file structure, is to use a tree. In this structure a
beam consists of a tree of the recordings are not necessary in the long
same, but each has a key field in a predetermined position
on the tape. Tree is sorted in the key fields and allow searches
fast for a certain key.


6. Access Methods
Files store information. When in use this information to be accessed and
read through the computer's memory. Information in the file can be accessed by multiple
way. Here are some how:
a. Sequential Access
This access is the simplest and most commonly used.
Information in the file are processed sequentially. For example, the editor and
compiler typically access the files this way.
b. Direct Access
The next method is direct access or access can be called a relative.
A file created from logical records whose length is
determined, which allows programs to read and write records
rapidly in no particular order

3 komentar:

Mohandes Zalatan mengatakan...

Hi Deby (:

Your blog is going to be better everyday. Hope it continues...

Thanks for the English translation also.

I just want to mention sth about deleting:
In deleting process sometimes only the filename would be removed and the file content may be still exist in the memory. Therefore sometimes we are able to recover deleted files. But if you shred a file rather than delete it then it would be much harder to recover it.

Good LucK Deby
ur bro, Armin

Deby Nussy mengatakan...

hy Armin...
thanks :)
its my pleasure,,,n now there smething new about the translate...u can see at left top,,n u will see translate,,what u do just click at name of ur languange then it will changed..
thanks for the mention, it also help me 2 mean bout it.
Good luck too
us sister, Deby
:) :) :)

Deby Nussy mengatakan...

Armin sory the theme was changed..
i mean about the translate position,,u can search at label wroten translate then just click it,,,
okey
:)

Posting Komentar