<s>
libfat	B-Library
(	O
with	O
a	O
lower	O
case	O
l	O
)	O
is	O
a	O
FAT	B-Application
library	O
made	O
by	O
Michael	O
"	O
Chishm	O
"	O
Chisholm	O
for	O
the	O
Nintendo	B-Device
DS	I-Device
to	O
code	O
Nintendo	B-Device
DS	I-Device
Homebrew	O
applications	O
.	O
</s>
<s>
It	O
is	O
the	O
successor	O
of	O
the	O
dual	O
GBA	O
NDS	B-Device
FAT	B-Application
library	O
,	O
which	O
was	O
also	O
used	O
,	O
like	O
libfat	B-Library
,	O
to	O
code	O
Nintendo	B-Device
DS	I-Device
homebrew	O
applications	O
.	O
</s>
<s>
It	O
is	O
packaged	O
as	O
part	O
of	O
DevKitARM	O
,	O
a	O
software	B-Application
development	I-Application
kit	I-Application
,	O
or	O
Devkit	B-Application
for	O
ARM	B-Architecture
microprocessor	I-Architecture
microprocessors	O
namely	O
the	O
ARM7TDMI(-S )	O
and	O
ARM946E-S	O
cores	O
used	O
in	O
the	O
Nintendo	B-Device
DS	I-Device
.	O
</s>
<s>
DLDI	O
(	O
or	O
Dynamically-Linked	O
Device	O
Interface	O
)	O
is	O
a	O
technology	O
created	O
by	O
Michael	O
"	O
Chishm	O
"	O
Chisholm	O
as	O
an	O
interface	O
for	O
libfat	B-Library
that	O
developers	O
attach	O
to	O
their	O
projects	O
.	O
</s>
<s>
libfat	B-Library
is	O
programmed	O
in	O
a	O
single	O
language	O
,	O
but	O
different	O
flashcarts	O
,	O
such	O
as	O
the	O
R4DS	B-Device
,	O
use	O
different	O
read/write	O
commands	O
.	O
</s>
<s>
Without	O
DLDI	O
,	O
libfat	B-Library
receives	O
encrypted	O
commands	O
from	O
the	O
flashcart	O
,	O
and	O
cannot	O
act	O
accordingly	O
,	O
so	O
it	O
sends	O
an	O
error	O
to	O
the	O
homebrew	O
explaining	O
that	O
it	O
cannot	O
understand	O
the	O
commands	O
,	O
which	O
then	O
presents	O
this	O
information	O
to	O
the	O
flashcart	O
,	O
and	O
the	O
user	O
,	O
in	O
the	O
form	O
of	O
a	O
black	O
screen	O
.	O
</s>
<s>
It	O
unencrypts	O
the	O
flashcart	O
's	O
specific	O
read/write	O
commands	O
and	O
converts	O
them	O
into	O
a	O
libfat-specific	O
programming	O
language	O
,	O
which	O
libfat	B-Library
can	O
understand	O
and	O
present	O
the	O
homebrew	O
with	O
information	O
which	O
can	O
then	O
be	O
passed	O
onto	O
the	O
flashcart/user	O
.	O
</s>
<s>
libfat	B-Library
,	O
like	O
any	O
FAT	B-Application
library	O
,	O
uses	O
a	O
main	O
source	O
file	O
.	O
</s>
<s>
The	O
library	O
's	O
operations	O
are	O
conducted	O
by	O
a	O
single	O
fat.h	O
file	O
in	O
the	O
source	O
file	O
with	O
the	O
code	O
:	O
</s>
<s>
libfat	B-Library
can	O
be	O
uniquely	O
programmed	O
to	O
use	O
the	O
slots	O
on	O
the	O
Nintendo	B-Device
DS	I-Device
Slot	O
1	O
being	O
the	O
main	O
DS	B-Device
cartridge	O
slot	O
,	O
Slot	O
2	O
being	O
the	O
GBA	O
slot	O
on	O
the	O
Nintendo	B-Device
DS	I-Device
and	O
DS	B-Device
Lite	O
,	O
and	O
SD	O
Card	O
slot	O
on	O
the	O
DSi	O
and	O
DSiXL	O
.	O
</s>
<s>
libfat	B-Library
can	O
use	O
or	O
boot	O
from	O
two	O
slots	O
at	O
the	O
same	O
time	O
,	O
as	O
in	O
taking	O
information	O
from	O
a	O
SLOT	O
2	O
device	O
while	O
running	O
the	O
main	O
program	O
from	O
SLOT	O
1	O
.	O
</s>
