sector

Reading a sector on the boot disk

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-05 11:55:11
This is a continuation of my question about reading the superblock . Let's say I want to target the HFS+ file system in Mac OS X. How could I read sector 2 of the boot disk? As far as I know Unix only provides system calls to read from files, which are never stored at that location. Does this require either 1) the program to run kernel mode, or 2) the program to be written in Assembly? I would prefer to avoid either of these restrictions, particularly the latter. In Linux, you can read from the special device file /dev/sda , assuming the hard drive you want to read is the first one. You need

Test native x86 programs, building bootable images/drives

旧街凉风 提交于 2019-12-04 20:21:58
I have the next problem: I'm working with NASM and building some native and compiling it on this way: nasm -f bin source -o out I'm getting my native program for x86. And now the most interesting, how can I make it bootable and then test it? As I think there are 3 ways to make bootable ( but for me, all they has failed :( ) using mkbt utility ( or another soft which is similar ) to write it to floppy disk building ISO image, with editing bootable sector in it manually write memory sector to usb/sd-card or another driver As for testing, all times rebooting PC is very bad, so it's better to use

How to find floppy\\ CD sector size in Linux?

孤街浪徒 提交于 2019-12-04 17:55:25
How can I get the sector size for floppy and CD disks in Linux, via C++ code? Thank you all. clyfe "#include <hdreg.h>" and use ioctl HDIO_GET_IDENTITY to obtain a struct hd_driveid . On this structure, the x->sector_bytes field is the sector size. #include <stdlib.h> #include <stdio.h> #include <sys/ioctl.h> #include <linux/hdreg.h> #include <fcntl.h> #include <errno.h> #include <string.h> #include <cctype> #include <unistd.h> int main(){ struct hd_driveid id; char *dev = "/dev/hdb"; int fd; fd = open(dev, O_RDONLY|O_NONBLOCK); if(fd < 0) { perror("cannot open"); } if (ioctl(fd, HDIO_GET

How to read individual sectors/clusters using DeviceIoControl() in Windows?

廉价感情. 提交于 2019-12-04 16:51:31
I dropped my laptop while Windows was preparing to hibernate and as a result, I got a head crash on the hard drive. (Teaches me to get a hard drive and/or laptop with a freefall sensor next time around.) Anyway, running SpinRite to try to recover the data has resulted in all the spare sectors on the disk to all be all used up for all the recoverable sectors so far. SpinRite is still going right now, but since there won't be anymore spare sectors to be used, I think it'll be a fruitless exercise except to tell me where all the bad sectors are. Anyway, I'm planning on writing an application to

What do “chunk”, “block”, “offset”, “buffer”, and “sector” mean?

被刻印的时光 ゝ 提交于 2019-12-04 09:44:25
问题 I have seen some of the scripts which are either dealing with archive or binary data or copy files (not using python default functions) use chunk or block or offset or buffer or sector . I have created a Python application and few of the requirements have been met by external libraries (archival / extracting data) or binaries. I would like to dive deeper now to get those third party library features into my application by writing a module of my own. Now I would like to know what those terms

What do “chunk”, “block”, “offset”, “buffer”, and “sector” mean?

假装没事ソ 提交于 2019-12-03 03:16:42
I have seen some of the scripts which are either dealing with archive or binary data or copy files (not using python default functions) use chunk or block or offset or buffer or sector . I have created a Python application and few of the requirements have been met by external libraries (archival / extracting data) or binaries. I would like to dive deeper now to get those third party library features into my application by writing a module of my own. Now I would like to know what those terms mean and where I can get started. Is there any documentation for the subject above? Any documentation

How can i determine the sector size in windows

被刻印的时光 ゝ 提交于 2019-12-03 00:53:30
问题 How can I determine the Physical Sector Size (e.g. if i have an Advanced Format drive with 4,096 byte sectors rather than the legacy 512 byte sectors) in Windows 7? I know that by clicking on a file and get properties we can find out the NTFS Cluster Size , but that's not the same as the hard-drive's sector size. Note : We ask about Windows 7 because it (and Windows Vista SP1) understand the existence of 4096 Advanced Format hard drives. 回答1: You want fsutil. Make sure you run Command Prompt

How can i determine the sector size in windows

限于喜欢 提交于 2019-12-02 14:17:20
How can I determine the Physical Sector Size (e.g. if i have an Advanced Format drive with 4,096 byte sectors rather than the legacy 512 byte sectors) in Windows 7? I know that by clicking on a file and get properties we can find out the NTFS Cluster Size , but that's not the same as the hard-drive's sector size. Note : We ask about Windows 7 because it (and Windows Vista SP1) understand the existence of 4096 Advanced Format hard drives. You want fsutil. Make sure you run Command Prompt as Admin. C:\Windows\system32>fsutil fsinfo ntfsinfo c: NTFS Volume Serial Number : 0xf4ca5d7cca5d3c54

Draw an arc/circle sector in QML?

匆匆过客 提交于 2019-12-01 04:44:43
I know that it is possible to draw a circle in QML using the following code: Rectangle { width: 150 height: 150 anchors.horizontalCenter: parent.horizontalCenter anchors.top: parent.top color: "#095e7b" border.color: "#0a2f4a" border.width: 2 radius: width*0.5 } My question is: what if I need to draw a sector of a circle. (Pizza Slices) and make each of these slices clickable? Can I do this using QML only? Mitch Yes, using Canvas (and Context2D ): import QtQuick 2.3 Rectangle { width: 400 height: 400 Canvas { anchors.fill: parent onPaint: { var ctx = getContext("2d"); ctx.reset(); var centreX

Draw an arc/circle sector in QML?

强颜欢笑 提交于 2019-12-01 02:45:29
问题 I know that it is possible to draw a circle in QML using the following code: Rectangle { width: 150 height: 150 anchors.horizontalCenter: parent.horizontalCenter anchors.top: parent.top color: "#095e7b" border.color: "#0a2f4a" border.width: 2 radius: width*0.5 } My question is: what if I need to draw a sector of a circle. (Pizza Slices) and make each of these slices clickable? Can I do this using QML only? 回答1: Yes, using Canvas (and Context2D): import QtQuick 2.3 Rectangle { width: 400