net: tcp_client_socket connection state routines
[quarnos.git] / resources / fdc.h
blob8f6cb6b4221e9c90708a738b0db1ca616adfcd6f
1 /* Quarn OS
3 * FDC
5 * Copyright (C) 2008-2009 Pawel Dziepak
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License along
18 * with this program; if not, write to the Free Software Foundation, Inc.,
19 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23 #include "resources/block.h"
24 #include "resources/device.h"
25 #include "isa.h"
27 namespace resources {
28 class fdc : public block {
29 private:
30 int sector_size;
31 int sectors_per_track;
33 void fdc_init();
34 void fdc_read_sector(void *data, int head, int cyl, int start, int stop);
35 void fdc_write_sector(void *source, int head, int cyl, int start, int stop);
37 /* Specific fdc orders */
38 void fdc_seek(int head, int cylinder);
39 void fdc_sense_int_status();
40 void fdc_recalibrate();
41 void fdc_read_data(int head, int cyl, int start, int stop);
42 void fdc_write_data(int head, int cyl, int start, int stop);
43 void fdc_set_disk_type();
44 void fdc_wait_command();
45 void fdc_wait_data();
46 void fdc_turn_off();
47 void fdc_reset();
48 void fdc_wait_int();
50 void fdc_isr_normal();
51 void fdc_isr_dma();
53 isa_did isaaddr;
55 volatile bool irq_occured;
56 public:
57 fdc();
59 void read_block(int address, int count, void *buffer);
60 void write_block(int address, int count, void *buffer);
62 int get_granulity();
64 bool init_device(p<did> iadr);
66 static void register_type();