[GOOD] BUILD 0.1.0.551 DATE 9/03/2011 AT 9:25 AM
==================================================== Mainly changed: HAL.FSs + Updated 'mount' call in floppy driver, now done after controller is initialized + Added 'detect' function for FAT file systems + Implemented 'initdr' driver, however still bugged + Improved logger
This commit is contained in:
26
Kernel/hal/filesys/fat/fat16.c
Normal file
26
Kernel/hal/filesys/fat/fat16.c
Normal file
@ -0,0 +1,26 @@
|
||||
/*
|
||||
* fat16.c
|
||||
*
|
||||
* Created on: Aug 31, 2011
|
||||
* Author: Tiberiu
|
||||
*/
|
||||
#include <fileio.h>
|
||||
#include <memory.h>
|
||||
#include "fat.h"
|
||||
|
||||
uint32 Fat16Detect (DevReadRoutine r, uint32 blocksz)
|
||||
{
|
||||
if (!r) return 0;
|
||||
|
||||
// Allocate buffer and call read routine
|
||||
void* buffer = kmalloc(blocksz);
|
||||
if (!(*r)(0,buffer)) return 0;
|
||||
|
||||
// Result of detection
|
||||
uint32 res = FatDetect(buffer);
|
||||
|
||||
// Cleanup
|
||||
kfree(buffer);
|
||||
return (res == 16);
|
||||
}
|
||||
|
Reference in New Issue
Block a user