From kevin at tyndur.org Thu Jan 1 18:52:47 2015 From: kevin at tyndur.org (Kevin Wolf) Date: Thu, 1 Jan 2015 18:52:47 +0100 Subject: [cdi-devel] [PATCH] floppy: Fix step_rate_time for SPECIFY Message-ID: <1420134767-8041-1-git-send-email-kevin@tyndur.org> The code was apparently based on the osdev.org wiki, which confused seconds and microseconds for step_rate_time, so we're off by a factor of 1000. It's fixed in the wiki for a couple of years now, so it might be time to fix it in this driver as well. Signed-off-by: Kevin Wolf --- floppy/device.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/floppy/device.c b/floppy/device.c index c5c75a5..76a27d8 100755 --- a/floppy/device.c +++ b/floppy/device.c @@ -286,10 +286,10 @@ static void floppy_drive_specify(struct floppy_device* device) // Der hier einzustellende Wert ist genau wie die vorderen 2 abhaengig von // der Datenrate. // Aus dem OSdev-Wiki stammt die folgende Formel fuer die Berechnung: - // step_rate_time = 16 - seconds * data_rate / 500000 + // SRT_value = 16 - (milliseconds * data_rate / 500000) // Fuer die Zeit wird 8ms empfohlen. - step_rate_time = 16 - 8 * FLOPPY_DATA_RATE(device) / 500000 / 1000; - + step_rate_time = 16 - 8 * FLOPPY_DATA_RATE(device) / 500 / 1000; + // Befehl und Argumente Senden // Byte 0: FLOPPY_CMD_SPECIFY // Byte 1: Bits 0 - 3: Head unload time -- 1.7.7 From kevin at tyndur.org Fri Jan 9 14:43:15 2015 From: kevin at tyndur.org (Kevin Wolf) Date: Fri, 9 Jan 2015 14:43:15 +0100 Subject: [cdi-devel] [PATCH v2 0/5] AHCI driver In-Reply-To: <1419792866-11944-1-git-send-email-kevin@tyndur.org> References: <1419792866-11944-1-git-send-email-kevin@tyndur.org> Message-ID: <20150109134314.GA5864@silvanus> On Sun, Dec 28, 2014 at 07:54:21PM +0100, Kevin Wolf wrote: > This series adds an AHCI driver. Tested in qemu and VirtualBox, additional > tests (and of course code reviews) are welcome. > > Unlike v1, I'm not planning to prepare another version of this series with more > features/cleanup/whatever, except to address review comments if necessary. > Without comments, I would consider it ready to be merged now. > > v2: > - Added CD-ROM support > - Added a little more serious error handling > - Improved the spec for cdi_provide_device_internal_drv() so that it > initialises yet uninitialised drivers > - A few little bugs here and there fixed > > Kevin Wolf (5): > cdi/misc.h: Add CDI_BUILD_BUG_ON() macro > cdi.h: Add cdi_driver.initialised > cdi.h: Add cdi_provide_device_internal_drv() > ahci: Controller and hard disk support > ahci: Add CD-ROM support As there don't seem to be any objections, applied to cdi.git master. Kevin From kevin at tyndur.org Sun Jan 11 15:23:38 2015 From: kevin at tyndur.org (Kevin Wolf) Date: Sun, 11 Jan 2015 15:23:38 +0100 Subject: [cdi-devel] [PATCH 0/4] cdi: Schnelleres CD-ROM und Fixes Message-ID: <1420986222-23055-1-git-send-email-kevin@tyndur.org> Cc: cdi-devel at tyndur.org Note for cdi-devel: This is a series for tyndur, with cdi-devel CCed for relevant patches, so you won't see all patches of the series. Kevin Wolf (4): cdi/cache: Fehlerpfad gefixt atapi: Support for transferring more than one sector cdi/scsi: Mehrere Sektoren auf einmal lesen atapi: Fix CDI_SCSI_WRITE src/modules/cdi/ata/atapi.c | 16 ++++++++++---- src/modules/cdi/ata/request.c | 2 +- src/modules/cdi/lib/cache.c | 46 ++++++++++++++++++++++++++++------------- src/modules/cdi/lib/scsi/disk.c | 25 ++++++++++++++-------- 4 files changed, 61 insertions(+), 28 deletions(-) -- 2.1.2 From kevin at tyndur.org Sun Jan 11 15:23:40 2015 From: kevin at tyndur.org (Kevin Wolf) Date: Sun, 11 Jan 2015 15:23:40 +0100 Subject: [cdi-devel] [PATCH 2/4] atapi: Support for transferring more than one sector In-Reply-To: <1420986222-23055-1-git-send-email-kevin@tyndur.org> References: <1420986222-23055-1-git-send-email-kevin@tyndur.org> Message-ID: <1420986222-23055-3-git-send-email-kevin@tyndur.org> This contains not only the modifications to actually split requests by the block size of 2048, but also included a fix to request.c, which used packet_size before it was initialised, so that always only a single block would be transferred. Cc: cdi-devel at tyndur.org Signed-off-by: Kevin Wolf --- src/modules/cdi/ata/atapi.c | 9 +++++++-- src/modules/cdi/ata/request.c | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/modules/cdi/ata/atapi.c b/src/modules/cdi/ata/atapi.c index eaac06d..b866551 100644 --- a/src/modules/cdi/ata/atapi.c +++ b/src/modules/cdi/ata/atapi.c @@ -127,13 +127,18 @@ int atapi_request(struct cdi_scsi_device* scsi,struct cdi_scsi_packet* packet) .lba = 1, .ata = 1 }, - .block_count = 1, - .block_size = packet->bufsize, + .block_count = packet->bufsize / 2048, + .block_size = 2048, .blocks_done = 0, .buffer = packet->buffer, .error = 0 }; + if (packet->bufsize < 2048) { + rw_request.block_count = 1; + rw_request.block_size = packet->bufsize; + } + // Lesen bzw. Schreiben der Daten // TODO: DMA if (packet->direction==CDI_SCSI_READ) ata_protocol_pio_in(&rw_request); diff --git a/src/modules/cdi/ata/request.c b/src/modules/cdi/ata/request.c index ff5d479..838f83c 100644 --- a/src/modules/cdi/ata/request.c +++ b/src/modules/cdi/ata/request.c @@ -278,7 +278,7 @@ int ata_protocol_pio_in(struct ata_request* request) // Wenn alle Blocks gelesen wurden ist der Transfer // abgeschlossen. return 1; - } else if (request->flags.ata && + } else if (request->flags.ata && packet_size && request->blocks_done*request->block_size>=packet_size) { // Wenn alle Bytes des ATAPI-Paketes gelesen wurden -- 2.1.2 From kevin at tyndur.org Sun Jan 11 15:23:42 2015 From: kevin at tyndur.org (Kevin Wolf) Date: Sun, 11 Jan 2015 15:23:42 +0100 Subject: [cdi-devel] [PATCH 4/4] atapi: Fix CDI_SCSI_WRITE In-Reply-To: <1420986222-23055-1-git-send-email-kevin@tyndur.org> References: <1420986222-23055-1-git-send-email-kevin@tyndur.org> Message-ID: <1420986222-23055-5-git-send-email-kevin@tyndur.org> This was implemented the same as CDI_SCSI_READ, but should be using the out function. Cc: cdi-devel at tyndur.org Signed-off-by: Kevin Wolf --- src/modules/cdi/ata/atapi.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/modules/cdi/ata/atapi.c b/src/modules/cdi/ata/atapi.c index b866551..31c7263 100644 --- a/src/modules/cdi/ata/atapi.c +++ b/src/modules/cdi/ata/atapi.c @@ -141,8 +141,11 @@ int atapi_request(struct cdi_scsi_device* scsi,struct cdi_scsi_packet* packet) // Lesen bzw. Schreiben der Daten // TODO: DMA - if (packet->direction==CDI_SCSI_READ) ata_protocol_pio_in(&rw_request); - else if (packet->direction==CDI_SCSI_WRITE) ata_protocol_pio_in(&rw_request); + if (packet->direction == CDI_SCSI_READ) { + ata_protocol_pio_in(&rw_request); + } else if (packet->direction == CDI_SCSI_WRITE) { + ata_protocol_pio_out(&rw_request); + } // Bei Fehler den Sense Key zurueckgeben status = ata_reg_inb(dev->controller, REG_STATUS); -- 2.1.2 From baesae at hotmail.ch Tue Jan 13 17:08:02 2015 From: baesae at hotmail.ch (Gurgel100) Date: Tue, 13 Jan 2015 17:08:02 +0100 Subject: [cdi-devel] [PATCH] Memoryleak in ISO9660 driver Message-ID: ! Added function call to free up the ressource structure Signed-off-by: OSDevNewbie --- iso9660/res.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iso9660/res.c b/iso9660/res.c index 7180eed..e526a4e 100644 --- a/iso9660/res.c +++ b/iso9660/res.c @@ -87,6 +87,7 @@ int iso9660_fs_res_destroy(struct iso9660_fs_res *res) { for (i=0;(child = cdi_list_get(res->res.children,i));i++) iso9660_fs_res_destroy(child); cdi_list_destroy(res->res.children); } + free(res); return 0; } -- 1.9.1 From kevin at tyndur.org Tue Jan 13 22:36:07 2015 From: kevin at tyndur.org (Kevin Wolf) Date: Tue, 13 Jan 2015 22:36:07 +0100 Subject: [cdi-devel] [PATCH] Memoryleak in ISO9660 driver In-Reply-To: References: Message-ID: <20150113213606.GA27656@silvanus> On Tue, Jan 13, 2015 at 05:08:02PM +0100, Gurgel100 wrote: > ! Added function call to free up the ressource structure > > Signed-off-by: OSDevNewbie Thanks, applied. Kevin