search for: read_sector

Displaying 20 results from an estimated 23 matches for "read_sector".

2013 Feb 08
6
[PATCH] 4k_sector: Support dynamic sectors in GPT MBR
This patches add support for dynamic sectors to GPT MBR code. First 3 patches are trick and optimizations to gain some space for the forth patch. I have a modified version of SeaBIOS, some code and some script o test it I'll send on a different mail.
2008 Jul 16
2
[PATCH 1/2] chain.c32: fix bounce buffer handling
...breakage in the "hide" option support patch: - The code which initialized the global variable "dapa" was lost in commit 81c203f2, therefore EBIOS access did not work properly. Fixed by removing the global variable completely and moving all bounce buffer handling into read_sector() and write_sector(). - write_sector() copied data to the bounce buffer, but then tried to use the pointer to the original buffer in BIOS calls. Signed-off-by: Sergey Vlasov <vsu at altlinux.ru> --- com32/modules/chain.c | 11 +++++++---- 1 files changed, 7 insertions(+), 4 deletions...
2012 Sep 10
19
Initial support for sector size >512
This set of patches add some support for sector size >512. Currently it fixes extlinux, MBR for GPT and ext partitions. Other code is unaffected. This set of patches has been tested on a read Dell machine running a beta firmware.
2006 Nov 14
2
isolinux menu32 (Re: Problems booting on Intel i9x5 motherboards.)
See: http://syslinux.zytor.com/archives/2006-May/006887.html I think I've tracked the problem down a bit more specifically. In edd.S when the kernel calls int 0x13 with %dl=80 [primary disk] & %al=1 [read one sector] and ah set to READ_SECTORS it never returns. However, the following code [which does drive diagnostics] works. mov $0x7E, %al call prtchr movw $0x0000, %ax movb $0x14 , %ah int $0x13 mov $0x7E, %al call prtchr However, when I attempt to reset the disk controller: movw $0x0000, %ax movb $0x80, %dl i...
2009 Mar 30
2
[PATCH 1/1] v2 Add Diagnostic MBR for trouble-shooting
...vb %ch, %dl /* value to write is partition number [1-4] */ + movw $msg_partition, %di + movb $0x01, %cl /* one nibble */ + call write_hex_value + +partition_get_offset: + movl 8(%si), %edx /* absolute starting sector (DWORD: partition_table[8]) */ + pushl %edx /* preserve for use in partition_read_sector */ + rorl $16, %edx /* swap low and high WORDs - high WORD needed in DX first */ + movw $msg_partition_offset_high, %di /* high WORD of DWORD */ + movb $0x04, %cl /* four nibbles */ + pushw %cx /* use again for low WORD */ + call write_hex_value + + /* at this point DI should be pointing to...
2017 Mar 19
1
"isolinux.bin missing or corrupt" when booting USB flash drive in old PC
...r EBIOS */ So it's just for simplicity or lazyness. As the code doesn't do any harm (supposedly) in that case the coder just lets it run. > > - I assume that > movw $0x7c00, %bx > movw $4, %cx /* Sector count */ > movl (lba_offset), %eax > 2: > call read_sector > ... > loopw 2b > shall load the bytes of isolinux.bin to address 0x7c00. Yes, I think so. It loads the next bootloader (which is four secors instead of the usual one) to 0x7c00. It's most likely is isolinux as it has confirmed the signature (the part that fails for...
2009 Mar 30
0
[PATCH 1/1] Add Diagnostic MBR for trouble-shooting
...vb %ch, %dl /* value to write is partition number [1-4] */ + movw $msg_partition, %di + movb $0x01, %cl /* one nibble */ + call write_hex_value + +partition_get_offset: + movl 8(%si), %edx /* absolute starting sector (DWORD: partition_table[8]) */ + pushl %edx /* preserve for use in partition_read_sector */ + rorl $16, %edx /* swap low and high WORDs - high WORD needed in DX first */ + movw $msg_partition_offset_high, %di /* high WORD of DWORD */ + movb $0x04, %cl /* four nibbles */ + pushw %cx /* use again for low WORD */ + call write_hex_value + + /* at this point DI should be pointing to...
2009 Mar 30
2
[PATCH 1/1] v3: Add Diagnostic MBR for trouble-shooting BIOS boot-order problems.
...vb %ch, %dl /* value to write is partition number [1-4] */ + movw $msg_partition, %di + movb $0x01, %cl /* one nibble */ + call write_hex_value + +partition_get_offset: + movl 8(%si), %edx /* absolute starting sector (DWORD: partition_table[8]) */ + pushl %edx /* preserve for use in partition_read_sector */ + rorl $16, %edx /* swap low and high WORDs - high WORD needed in DX first */ + movw $msg_partition_offset_high, %di /* high WORD of DWORD */ + movb $0x04, %cl /* four nibbles */ + pushw %cx /* use again for low WORD */ + call write_hex_value + + /* at this point DI should be pointing to...
2017 Mar 21
3
"isolinux.bin missing or corrupt" when booting USB flash drive in old PC
...e if we have EBIOS */ pushw %dx /* drive number */ movb $0x41, %ah /* %al == 0 already */ movw $0x55aa, %bx xorw %cx, %cx xorb %dh, %dh stc int $0x13 jc 1f cmpw $0xaa55, %bx jne 1f andw $1,%cx /* Bit 0 = fixed disk subset */ jz 1f /* We have EBIOS; patch in the following code at read_sector_cbios: movb $0x42, %ah ; jmp read_common */ movl $0xeb42b4+((read_common-read_sector_cbios-4) << 24), \ (read_sector_cbios) #ifdef DEBUG_PRINT push %si call print_string .ascii "E\r\n" jmp 2f 1: push %si call print_string .ascii "C\r\n" 2: pop %si #else 1: #e...
2010 Jul 24
0
[PATCH] chain.c: allocation fixes
...art); return NULL; } @@ -889,6 +899,7 @@ static struct disk_part_iter *get_first_partition(struct disk_part_iter *part) error("Count not allocate partition iterator!\n"); goto err_alloc_iter; } + memset(part, 0, sizeof(*part)); /* Read MBR */ part->block = read_sectors(0, 2); if (!part->block) { @@ -940,16 +951,10 @@ static struct disk_part_iter *get_first_partition(struct disk_part_iter *part) return part->next(part); err_gpt_table: - err_mbr: - - free(part->block); - part->block = NULL; err_read_mbr: - - free(part); err_all...
2007 Oct 17
3
Adding a "boot from local hard disk" option to syslinux menu, booted from USB
...oto endloop; } sprintf(logs, "disk_info: disk %d, ebios %d, cbios %d, head %d, sect %d\n", disk_info.disk, disk_info.ebios, disk_info.cbios, disk_info.head, disk_info.sect); printf(logs); strcat(logrc, logs); /* Get MBR */ sprintf(logs, "Get MBR - Calling read_sector\n"); printf(logs); strcat(logrc, logs); if ( read_sector(mbr, 0) ) { //error(); sprintf(logs, "Cannot read Master Boot Record\n"); error(logs); strcat(logrc, logs); goto endloop; } sprintf(logs, "mbr: %s ...\n", mbr); printf(logs);...
2009 Mar 30
0
[PATCH 0/1] v2 Add Diagnostic MBR for trouble-shooting
Changes: * Fix [C]HS indicator over-write (was showing '5' not 'C') * Use 0xDEAD as magic-bytes filler to make it clear when read_sector didn't replace it * Improvements to commentary and description. TJ (1): Add Diagnostic MBR for trouble-shooting mbr/Makefile | 6 +- mbr/mbr-diag.S | 372 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 377 insertions(+), 1 deletions(-) create mode 100644...
2009 Mar 30
0
[PATCH 0/3] mbr: Ctrl-key press forces load from first hard disk
...vice order lists an external device (e.g. a USB flash mass-storage device) before the IDE/SCSI hard disk the USB device is the 'first' hard disk and should have drive number 0x80. The problem is some BIOSs report the wrong boot device number in DL but use the correct device number when the read_sector functions (AH=0x02/0x42, int 0x13) are called. This was discovered using the new diagnostic MBR: mbr-diag. mbr and isohdpfx are relatively straight-forward patches. gptmbr needed its ASCII strings shortened to create the space required for the new code. The space-saving changes were briefly disc...
2010 Apr 16
0
Calling getoneblk() from com32
Is there an easy way to call getoneblk() (along with access to the required disk struct) from com32? I know I can use the gpllib read_sectors() but since the device_init already has the c/h/s/etc it sure would be nice to grab it from there and use getoneblk(). Any hints are greatly appreciated. Cheers, don
2017 Mar 19
1
"isolinux.bin missing or corrupt" when booting USB flash drive in old PC
Thomas Schmitt wrote: > I ponder whether it would be possible to create a diagnostic MBR > which does not necessarily have to boot but rather tells what the > isohybrid MBR would perceive: Presence of partition table, > EBIOS or CBIOS, block address used with INT 13, content of the block > read by the first INT 13, ... ... > The diagnostic MBR should only use 432 bytes because at
2017 Mar 21
0
Patch: make slightly more verbose versions of isohdp.x.S
...+ push %si + call print_string + .ascii "G\r\n" + pop %si +#endif jmp 1f /* We have non-GPT partition information */ 2: +#ifdef DEBUG_PRINT + push %si + call print_string + .ascii "M\r\n" + pop %si +#endif + movl 8(%si), %ecx #endif 1: @@ -167,14 +181,34 @@ next: read_sector_cbios: movb $0x42, %ah ; jmp read_common */ movl $0xeb42b4+((read_common-read_sector_cbios-4) << 24), \ (read_sector_cbios) - jmp 1f + +#ifdef DEBUG_PRINT + push %si + call print_string + .ascii "E\r\n" + jmp 2f 1: + push %si + call print_string + .ascii "C\r\n" +2:...
2012 Aug 10
1
[PATCH 4/4] Support sectors >512
...$0x200, -6(%bp) /* -6(%bp) sector size */ /* Check to see if we have EBIOS */ pushw %dx /* drive number */ @@ -86,6 +92,7 @@ next: xorb %dh, %dh stc int $0x13 + popw %dx /* restore drive */ jc 1f cmpw $0xaa55, %bx jne 1f @@ -97,22 +104,32 @@ next: movl $0xeb42b4+((read_common-read_sector_cbios-4) << 24), \ (read_sector_cbios) -1: - popw %dx + /* + * read sector size. + * Should not fail but if it does I assume that at least + * previous 512 value is not overridden + */ + movb $0x48, %ah + movw %sp, %si + jmp 2f /* this can be replaced by a .byte 0xbf to gain +...
2010 Apr 27
2
gpllib write_sectors() patch
Here is a partial patch that I'm using to illustrate a few questions that I have. Looking at the gpllib write_sectors (com32/gpllib/disk/write.c) it looks like the allocated size is wrong; size is in sectors so we should adjust the alloc/memcpy by size*SECTOR. Also, comparing core/diskio.c it looks like the registers aren't even setup right. In the patch below I put an #if 0 around the
2012 Jun 26
2
[GIT PULL] elflink bug fixes
...memcpy(&drive_info->edd_params, dp, sizeof drive_info->edd_params); + lfree(dp); return 0; } diff --git a/com32/gpllib/disk/read.c b/com32/gpllib/disk/read.c index 7a6cc43..541957f 100644 --- a/com32/gpllib/disk/read.c +++ b/com32/gpllib/disk/read.c @@ -76,13 +76,22 @@ int read_sectors(struct driveinfo *drive_info, void *data, const unsigned int lba, const int sectors) { com32sys_t inreg, outreg; - struct ebios_dapa *dapa = __com32.cs_bounce; - void *buf = (char *)__com32.cs_bounce + sectors * SECTOR; + struct ebios_dapa *dapa; + void *buf; char *bufp...
2012 Aug 02
0
[PATCH 3/3] ALPHA: implement and use rdwr_bytes
...23e92..f0a3fa8 100644 --- a/core/include/disk.h +++ b/core/include/disk.h @@ -7,6 +7,7 @@ typedef uint64_t sector_t; typedef uint64_t block_t; +typedef uint64_t bytes_t; /* * struct disk: contains the information about a specific disk and also @@ -29,6 +30,7 @@ struct disk { extern void read_sectors(char *, sector_t, int); extern void getoneblk(struct disk *, char *, block_t, int); +extern int rdwr_bytes(struct disk *, void *, bytes_t, size_t, bool); /* diskio.c */ struct disk *disk_init(uint8_t, bool, sector_t, uint16_t, uint16_t, uint32_t); -- 1.7.5.4