1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 05:47:35 +00:00

Remove old DatBuffer class.

(also increase the number of sectors loaded by the bootloader in the
since I just noticed we were at the limit. This is not the ideal way
of doing this.)
This commit is contained in:
Andreas Kling 2018-10-25 10:49:43 +02:00
parent de7c54545a
commit 4bd69d4352
6 changed files with 9 additions and 128 deletions

View file

@ -6,7 +6,6 @@
#include "StdLib.h"
#include "IO.h"
#include "i386.h"
#include "DataBuffer.h"
#include "PIC.h"
//#define DISK_DEBUG
@ -88,11 +87,11 @@ void initialize()
enableIRQ();
waitForInterrupt();
RefPtr<DataBuffer> wbuf = DataBuffer::createUninitialized(512);
BYTE* byteBuffer = new BYTE[512];
BYTE* b = byteBuffer;
WORD* wbufbase = (WORD*)wbuf->data();
WORD* w = (WORD*)wbuf->data();
ByteBuffer wbuf = ByteBuffer::createUninitialized(512);
ByteBuffer bbuf = ByteBuffer::createUninitialized(512);
BYTE* b = bbuf.pointer();
WORD* w = (WORD*)wbuf.pointer();
const WORD* wbufbase = (WORD*)wbuf.pointer();
for (DWORD i = 0; i < 256; ++i) {
WORD data = IO::in16(IDE0_DATA);
@ -102,8 +101,8 @@ void initialize()
}
// "Unpad" the device name string.
for (DWORD i = 93; i > 54 && byteBuffer[i] == ' '; --i)
byteBuffer[i] = 0;
for (DWORD i = 93; i > 54 && bbuf[i] == ' '; --i)
bbuf[i] = 0;
drive[0].cylinders = wbufbase[1];
drive[0].heads = wbufbase[3];
@ -111,13 +110,11 @@ void initialize()
kprintf(
"ide0: Master=\"%s\", C/H/Spt=%u/%u/%u\n",
byteBuffer + 54,
bbuf.pointer() + 54,
drive[0].cylinders,
drive[0].heads,
drive[0].sectors_per_track
);
delete byteBuffer;
}
struct CHS {