Skip to content
Snippets Groups Projects
Commit 5d2b62ea authored by Stephen D's avatar Stephen D
Browse files

Floppy driver done for now

parent 62abcdcd
No related branches found
No related tags found
No related merge requests found
......@@ -532,11 +532,11 @@ int floppy_read_track(unsigned cyl, char *data, void(*callback)(int response)) /
{
if(floppy_ready)
{
floppy_ready = 0;
floppy_queue = 1;
cyl_queue = cyl;
callback_queue = callback;
data_queue = data;
floppy_ready = 0;
floppy_queue = 1;
}
return 27; //Data transfer already in progress
}
......@@ -546,10 +546,10 @@ int floppy_write_track(unsigned cyl, char *data, void (*callback)(int response))
if(floppy_ready)
{
memory_copy((unsigned char*)data, (unsigned char*)&flp_dmabuf, 0x4800);
floppy_ready = 0;
floppy_queue = 2;
cyl_queue = cyl;
callback_queue = callback;
floppy_ready = 0;
floppy_queue = 2;
return 0;
}
return 27; //Data transfer already in progress
......
......@@ -43,7 +43,7 @@ void main() {
println("WARNING: This type of floppy drive is not supported by the system.");
}
println("STEVEOS V0.0.2");
println("STEVEOS V0.0.3");
println("WRITTEN BY STEPHEN DOWNWARD");
println("TYPE \"HELP\" FOR HELP.");
print("> ");
......
......@@ -105,6 +105,7 @@ char buffer[0x4800];
void read_callback(int p)
{
println(buffer);
println(&buffer[0x3c47]);
println("done");
UNUSED(p);
......@@ -114,7 +115,20 @@ void read_disk(char *args)
{
UNUSED(args);
floppy_read_track(1, buffer, read_callback);
floppy_read_track((args[0] - '0'), buffer, read_callback);
}
void write_callback(int p)
{
UNUSED(p);
println("done");
}
void write_disk(char *args)
{
UNUSED(args);
strcpy(buffer, "writing this text to the floppy");
floppy_write_track((args[0]-'0'), buffer, write_callback);
}
void register_commands()
......@@ -126,6 +140,6 @@ void register_commands()
register_command("halt", halt_cpu);
register_command("vinfo", video_debug);
register_command("edit", editor);
/*register_command("fm", motor_control);*/
register_command("wd", write_disk);
register_command("rd", read_disk);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment