Git Product home page Git Product logo

gpart's Introduction

gpart

Build Status

Gpart is a small tool which tries to guess what partitions are on a PC type, MBR-partitioned hard disk in case the primary partition table was damaged.

Gpart works by scanning through the device (or file) given on the command line on a sector basis. Each guessing module is asked if it thinks a filesystem it knows about could start at a given sector. Several filesystem guessing modules are built in.

Consult the manual page for command line options and usage.

Installation

See file INSTALL.

Currently recognized partitions/filesystems types

Modname Typ Description
fat 0x01 Primary DOS with 12 bit FAT
0x04 Primary DOS with 16 bit FAT (<= 32MB)
0x06 Primary 'big' DOS (> 32MB)
0x0B DOS or Windows 95 with 32 bit FAT
0x0C DOS or Windows 95 with 32 bit FAT, LBA
ntfs 0x07 OS/2 HPFS, NTFS, QNX or Advanced UNIX
hpfs 0x07 OS/2 HPFS, NTFS, QNX or Advanced UNIX
ext2 0x83 Linux ext2 filesystem
lswap 0x82 Linux swap
bsddl 0xA5 FreeBSD/NetBSD/386BSD
s86dl 0x82 Solaris/x86 disklabel
minix 0x80 Minix V1
0x81 Minix V2
reiserfs 0x83 ReiserFS filesystem
hmlvm 0xFE Linux LVM physical volumes
qnx4 0x4F QNX 4.x
beos 0xEB BeOS fs
xfs 0x83 SGI XFS filesystem
btrfs 0x83 BtrFS
LVM2 0x8E LVM2

Guessing modules

Each guessing module must provide three functions callable from gpart:

int xxx_init(disk_desc *d,g_module *m)

Initialisation function. Will be called before a scan. It should return the minimum number of bytes it wants to receive for a test. The module should set the description of the filesystem/partition type it handles in g_module.m_desc. If the filesystem/partition type included a partition table like first sector (like the *BSD disklabels do), the flag m_hasptbl should be set. Another flag is m_notinext which means the tested type cannot reside in a logical partition.

int xxx_term(disk_desc *d)

Termination/cleanup function, called after the scanning of the device has been done.

int xxx_gfun(disk_desc *d,g_module *m)

The actual guessing function, called from within the scan loop. It should test the plausibility of the given sectors, and return its guess in m->m_guess (a probability between 0 and 1). See existing modules for examples.

The given file descriptor d->d_fd can be used for seeking and reading (see e.g. gm_ext2.c which tries to read the first spare superblock). If a module is convinced that it has found a filesystem/partition start it should fill in the assumed begin and size of the partition.

The test performed should not be too pedantic, for instance it should not be relied upon that the file- system is clean/was properly unmounted. On the other hand too much tolerance leads to misguided guesses, so a golden middle way must be found.

Output explanation

Here is a sample gpart -v run on my first IDE hard disk (comments in block-quotes):

dev(/dev/hda) mss(512) chs(1232/255/63)(LBA) #s(19792080) size(9664mb)

mss is the medium sector size, chs the geometry retrieved from the OS (or from the command line), #s is the total sector count.

Primary partition(1)
   type: 006(0x06)(Primary 'big' DOS (> 32MB)) (BOOT)
   size: 502mb #s(1028097) s(63-1028159)
   chs:  (0/1/1)-(63/254/63)d (0/1/1)-(63/254/63)r
   hex:  80 01 01 00 06 FE 3F 3F 3F 00 00 00 01 B0 0F 00

size: the size of the partition in megabytes, number of sectors and the sector range. chs: the partition table chs range (d) and the real one (r). If the number of cylinders is less than 1024, both are identical. hex: the hexadecimal representation of the partition entry as found in the partition table.

...

Begin scan...
Possible partition(DOS FAT), size(502mb), offset(0mb)
   type: 006(0x06)(Primary 'big' DOS (> 32MB))
   size: 502mb #s(1028097) s(63-1028159)
   chs:  (0/1/1)-(63/254/63)d (0/1/1)-(63/254/63)r
   hex:  00 01 01 00 06 FE 3F 3F 3F 00 00 00 01 B0 0F 00

Possible extended partition at offset(502mb)
    Possible partition(Linux ext2), size(31mb), offset(502mb)
      type: 131(0x83)(Linux ext2 filesystem)
      size: 31mb #s(64196) s(1028223-1092418)
      chs:  (64/1/1)-(67/254/62)d (64/1/1)-(67/254/62)r
      hex:  00 01 01 40 83 FE 3E 43 7F B0 0F 00 C4 FA 00 00

   Possible partition(Linux swap), size(125mb), offset(533mb)
      type: 130(0x82)(Linux swap or Solaris/x86)
      size: 125mb #s(256976) s(1092483-1349458)
      chs:  (68/1/1)-(83/254/62)d (68/1/1)-(83/254/62)r
      hex:  00 01 01 44 82 FE 3E 53 83 AB 10 00 D0 EB 03 00

During the scan phase all found partitions are listed by their real type names. The Linux swap partition above is recognized as Linux swap but will get the 0x82 partition identifier which can be both a Solaris disklabel or a Linux swap partition.

When examining the hex values of the first primary partition it can be seen that they are identical to the values of the actual partition table (good guess) except for the first value (0x80 vs. 0x00). This entry denotes the partition 'boot' flag which cannot be guessed.

...

End scan.

Checking partitions...
Partition(Primary 'big' DOS (> 32MB)): primary
   Partition(Linux ext2 filesystem): logical
   Partition(Linux swap or Solaris/x86): logical
   Partition(Linux LVM physical volume): logical
   Partition(Linux ext2 filesystem): logical
   Partition(DOS or Windows 95 with 32 bit FAT, LBA): logical
Partition(FreeBSD/NetBSD/386BSD): primary
Partition(Linux LVM physical volume): primary
Ok.

During the scan phase gpart gathers a simple list of possible partitions, the check phase now tries to decide if found extended partitions seem consistent, if partitions do not overlap etc. Overlapping partitions are silently discarded, all remaining ones are given an attribute 'primary', 'logical', 'orphaned' or 'invalid'. If gpart is called like gpart -vv ..., it also tells why it thinks a partition guess is invalid.

If any inconsistencies are found, gpart prints the number of remaining inconsistencies, otherwise it says 'Ok.'

Guessed primary partition table:
Primary partition(1)
   type: 006(0x06)(Primary 'big' DOS (> 32MB))
   size: 502mb #s(1028097) s(63-1028159)
   chs:  (0/1/1)-(63/254/63)d (0/1/1)-(63/254/63)r
   hex:  00 01 01 00 06 FE 3F 3F 3F 00 00 00 01 B0 0F 00

Primary partition(2)
   type: 005(0x05)(Extended DOS)
   size: 6157mb #s(12611025) s(1028160-13639184)
   chs:  (64/0/1)-(848/254/63)d (64/0/1)-(848/254/63)r
   hex:  00 00 01 40 05 FE FF 50 40 B0 0F 00 D1 6D C0 00

Primary partition(3)
   type: 165(0xA5)(FreeBSD/NetBSD/386BSD)
   size: 1396mb #s(2859570) s(13639185-16498754)
   chs:  (849/0/1)-(1023/254/63)d (849/0/1)-(1026/254/63)r
   hex:  00 00 C1 51 A5 FE FF FF 11 1E D0 00 32 A2 2B 00

Primary partition(4)
   type: 254(0xFE)(Linux LVM physical volume)
   size: 1608mb #s(3293325) s(16498755-19792079)
   chs:  (1023/254/63)-(1023/254/63)d (1027/0/1)-(1231/254/63)r
   hex:  00 FE FF FF FE FE FF FF 43 C0 FB 00 8D 40 32 00

This is a resulting primary partition table. Note that the logical partition guesses were only used to create the extended partition entry. Up to now gpart cannot reconstruct a damaged logical partition chain itself.

If a guessed primary partition table should be written to some file or device the user must specify (via the -W option) which partition gets the active (bootable) one.

Author

gpart README, Aug 1999, Michail Brzitwa [email protected]

gpart's People

Contributors

baruch avatar carstengrohmann avatar harababurel avatar ian-abbott avatar jonathanspw avatar mwilck avatar pevik avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gpart's Issues

Add support for GPT

I will be great if gpart could write GUID Patition Tables. It can recover de partiions from a GPT partitioned disk, however it won't be able to write the table since only admits 3 primary partitions

Would be nice if gpart could do human-readable partition reading

Dear developer,

Thank you for making gpart. It would be nice if the user/admin could pass some sort of human-readable argument such as - GB -TB for partition sizes as right now it only shows in mb which takes some time from the user to convert the same into GB or TB as the case may be.

gpart does not respect docdir.

I recently compiled gpart from source on slackware linux and found that gpart does not respect "--docdir", instead it uses "--datadir". Though it still gets this wrong because instead of respecting something like "--datadir=/usr/doc/$PRGNAM-$VERSION", it will stick them in "/usr/doc/${PRGNAM}-$VERSION/doc/gpart" making me have to add a line like this to my slackbuild, "rm -rf $PKG/usr/doc/${PRGNAM}-$VERSION/doc".

This is not a deal breaker, but can it still get fixed anyways? Thanks!

Fails to detect LVM partitions

gpart fails to detect lvm2 physical volumes, which ought to easy to
recognize.

the test setup i used was like this:

  • dd if=/dev/zero bs=4096 count=4096 of=./test
  • losetup /dev/loop1 ./test
  • fdisk /dev/loop1 # create a single partition with default parameters
  • sudo kpartx -a /dev/loop1
  • pvcreate /dev/mapper/loop1p1
  • gpart ./test

lvm partitions are pretty widespread these days, so users could
reasonably assume those partition types to be detected. i'd therefore
suggest to add lvm2 support to gpart.

(ticket copied from Debian BTS #705076)

gpart runs for 36 hours at this time scanning a 6 TB HDD connected via USB - is this normal?

I discovered gpart while using gparted, via the option "attempt data rescue".
After I unfortunately dropped my 6 TB HDD by Toshiba (it wasn't running at that time) from around 1 m height, it acted a bit weird. It was recognized as usual, but it always experienced HDD activity, even when I didn't do anything (browsing into new folders or accessing files). It worked like this three times, when I wanted to come back to it for a fourth time since the drop it wasn't recognized anymore.
It now shows as "unallocated", it had an NTFS partition, spanning it's whole size. It had between 2 and 3 of the 6 TB used.

The aforementioned "attempt data rescue" option in gparted gave up right away (it said something like "no filesystem could be recognized") so I tried gpart itself via the console. I did type "sudo gpart /dev/sdb", that runs for 36 hours now. The HDD still shows activity, so I assume that gpart is still scanning the drive. I use a normal, older USB 1.0 / 2.0 A to B cable instead of a newer USB 3.0 one which would have extra contacts on the B plug.

ThinkPad-X230-Tablet-LM:~$ sudo gpart /dev/sdb
[sudo] password for :

Begin scan...
Possible partition(Windows NT/W2K FS), size(1528861mb), offset(1mb)

That's what appeared right away when it started 36 hours ago and nothing else appeared since.

It would be nice if gpart could restore the filesystem, I assume that I can get all the files back by using photorec but I would loose the folder structure and the filenames ...

"ioctl(HDIO_GETGEO) failed:" Could be more helpful.

I tried to use gpart for a quick check whether it could recover the
broken partition table from a (relatively unimportant) USB stick
image. I was greeted with the error message

*** Fatal error: ioctl(HDIO_GETGEO) failed: Invalid argument.

I admit this is sufficient for the initiated.

However, it will lead the uninitiated towards using the device itself,
instead of the image. At least that is what I did, being in the hurry I
was. That got rid of the message all right - allthough I feel using the
device instead of the copy is somehow the "wrong way". Also, the "device
itself" is rather slow in my paticular case.

In my view, an addition to the error message would be helpful.

I suggest something like the following:

*** Fatal error: ioctl(HDIO_GETGEO) failed: Invalid argument.
Disc geometry information could not be read.
(Maybe you want to try either the -C or the -g option.)

Regards, and thank you for providing fine software

Andreas

(ticket copied from Debian BTS #341935)

Is it a fork?

gpart in Fedora is still in 0.1h, I don't know if archlinux has packaged a fork in their official repo? Since they use your project URL as homepage of gpart package.

Thanks.

v0.2.2 identifies itself as v0.2.1

I'm not sure if v0.2.2 has been formally released but at least Debian has a package for it.

The version was not updated in configure.ac so the program still reports its version as v0.2.1.

Anyway, I guess it's too late to fix it now (unless distros want to apply their own patch), but I thought I'd raise the issue as a reminder for the next release!

Crash on a LUKS image

Fedora issue https://bugzilla.redhat.com/show_bug.cgi?id=1258174:

There is a crash when trying to run gpart on a luks image:

gpart -v /dev/mapper/luks-854657c3-3ec5-4a09-9357-e004c4839038
[New LWP 8077]
Core was generated by `gpart -v /dev/mapper/luks-854657c3-3ec5-4a09-9357-e004c4839038'.
Program terminated with signal SIGFPE, Arithmetic exception.
#0  0x00000000004032f1 in disk_geometry (d=d@entry=0x19f96a0) at disku.c:86
86  disku.c: No such file or directory.

Thread 1 (LWP 8077):
#0  0x00000000004032f1 in disk_geometry (d=d@entry=0x19f96a0) at disku.c:86
        g = {d_c = 0, d_h = 0, d_s = 0, d_nsecs = 490228575}
        nsects = 490228575
        hg = {heads = 0 '\000', sectors = 0 '\000', cylinders = 0, start = 0}
        st = {st_dev = 6, st_ino = 88180, st_nlink = 1, st_mode = 25008, st_uid = 0, st_gid = 6, __pad0 = 0, st_rdev = 64770, st_size = 0, st_blksize = 4096, st_blocks = 0, st_atim = {tv_sec = 1440884950, tv_nsec = 338282602}, st_mtim = {tv_sec = 1440884912, tv_nsec = 761585919}, st_ctim = {tv_sec = 1440884912, tv_nsec = 761585919}, __unused = {0, 0, 0}}
        lba = <optimized out>
#1  0x0000000000402803 in get_disk_desc (sectsize=0, dev=0x7fff0bb7b70e "/dev/mapper/luks-854657c3-3ec5-4a09-9357-e004c4839038") at gpart.c:829
        ubuf = 0x19f4690 ""
        buf = 0x19f5000 ""
        psize = 4096
        d = 0x19f96a0
        ssize = <optimized out>
        dg = <optimized out>
#2  main (ac=<optimized out>, av=<optimized out>) at gpart.c:1809
        optstr = 0x407340 "b:C:cdEefghiK:k:Ll:n:qs:t:VvW:w:"
        p1 = <optimized out>
        p2 = <optimized out>
        p3 = <optimized out>
        odev = 0x0
        backup = 0x0
        opt = <optimized out>
        sectsize = 0
        no_of_incons = 0
        d = 0x19f96a0
From                To                  Syms Read   Shared Object Library
0x00007f2b9ea98ed0  0x00007f2b9ea999d0  Yes         /lib64/libdl.so.2
0x00007f2b9e6f9560  0x00007f2b9e83ab24  Yes         /lib64/libc.so.6
0x00007f2b9ec9cb10  0x00007f2b9ecb5c30  Yes         /lib64/ld-linux-x86-64.so.2
$1 = 0x0
No symbol "__glib_assert_msg" in current context.
rax            0x1d384b5f   490228575
rbx            0x19f96a0    27236000
rcx            0x0  0
rdx            0x0  0
rsi            0x0  0
rdi            0x0  0
rbp            0x7fff0bb7b70e   0x7fff0bb7b70e
rsp            0x7fff0bb7b0e0   0x7fff0bb7b0e0
r8             0x1  1
r9             0x73 115
r10            0x7fff0bb7aea0   140733389975200
r11            0x246    582
r12            0x0  0
r13            0x7fff0bb7b410   140733389976592
r14            0x0  0
r15            0x19f96a0    27236000
rip            0x4032f1 0x4032f1 <disk_geometry+225>
eflags         0x10246  [ PF ZF IF RF ]
cs             0x33 51
ss             0x2b 43
ds             0x0  0
es             0x0  0
fs             0x0  0
gs             0x0  0
st0            0    (raw 0x00000000000000000000)
st1            0    (raw 0x00000000000000000000)
st2            0    (raw 0x00000000000000000000)
st3            0    (raw 0x00000000000000000000)
st4            0    (raw 0x00000000000000000000)
st5            0    (raw 0x00000000000000000000)
st6            0    (raw 0x00000000000000000000)
st7            0    (raw 0x00000000000000000000)
fctrl          0x37f    895
fstat          0x0  0
ftag           0xffff   65535
fiseg          0x0  0
fioff          0x0  0
foseg          0x0  0
fooff          0x0  0
fop            0x0  0
mxcsr          0x1f80   [ IM DM ZM OM UM PM ]
ymm0           {v8_float = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v4_double = {0x0, 0x0, 0x0, 0x0}, v32_int8 = {0x0 <repeats 11 times>, 0xff, 0x0 <repeats 20 times>}, v16_int16 = {0x0, 0x0, 0x0, 0x0, 0x0, 0xff00, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v8_int32 = {0x0, 0x0, 0xff000000, 0x0, 0x0, 0x0, 0x0, 0x0}, v4_int64 = {0x0, 0xff000000, 0x0, 0x0}, v2_int128 = {0x00000000ff0000000000000000000000, 0x00000000000000000000000000000000}}
ymm1           {v8_float = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v4_double = {0x8000000000000000, 0x8000000000000000, 0x0, 0x0}, v32_int8 = {0x76 <repeats 16 times>, 0x0 <repeats 16 times>}, v16_int16 = {0x7676, 0x7676, 0x7676, 0x7676, 0x7676, 0x7676, 0x7676, 0x7676, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v8_int32 = {0x76767676, 0x76767676, 0x76767676, 0x76767676, 0x0, 0x0, 0x0, 0x0}, v4_int64 = {0x7676767676767676, 0x7676767676767676, 0x0, 0x0}, v2_int128 = {0x76767676767676767676767676767676, 0x00000000000000000000000000000000}}
ymm2           {v8_float = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v4_double = {0x0, 0x0, 0x0, 0x0}, v32_int8 = {0x0 <repeats 32 times>}, v16_int16 = {0x0 <repeats 16 times>}, v8_int32 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v4_int64 = {0x0, 0x0, 0x0, 0x0}, v2_int128 = {0x00000000000000000000000000000000, 0x00000000000000000000000000000000}}
ymm3           {v8_float = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v4_double = {0x0, 0x0, 0x0, 0x0}, v32_int8 = {0x0 <repeats 32 times>}, v16_int16 = {0x0 <repeats 16 times>}, v8_int32 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v4_int64 = {0x0, 0x0, 0x0, 0x0}, v2_int128 = {0x00000000000000000000000000000000, 0x00000000000000000000000000000000}}
ymm4           {v8_float = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v4_double = {0x0, 0x0, 0x0, 0x0}, v32_int8 = {0x0 <repeats 32 times>}, v16_int16 = {0x0 <repeats 16 times>}, v8_int32 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v4_int64 = {0x0, 0x0, 0x0, 0x0}, v2_int128 = {0x00000000000000000000000000000000, 0x00000000000000000000000000000000}}
ymm5           {v8_float = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v4_double = {0x0, 0x0, 0x0, 0x0}, v32_int8 = {0x0 <repeats 32 times>}, v16_int16 = {0x0 <repeats 16 times>}, v8_int32 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v4_int64 = {0x0, 0x0, 0x0, 0x0}, v2_int128 = {0x00000000000000000000000000000000, 0x00000000000000000000000000000000}}
ymm6           {v8_float = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v4_double = {0x0, 0x0, 0x0, 0x0}, v32_int8 = {0x0 <repeats 32 times>}, v16_int16 = {0x0 <repeats 16 times>}, v8_int32 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v4_int64 = {0x0, 0x0, 0x0, 0x0}, v2_int128 = {0x00000000000000000000000000000000, 0x00000000000000000000000000000000}}
ymm7           {v8_float = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v4_double = {0x0, 0x0, 0x0, 0x0}, v32_int8 = {0x0 <repeats 32 times>}, v16_int16 = {0x0 <repeats 16 times>}, v8_int32 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v4_int64 = {0x0, 0x0, 0x0, 0x0}, v2_int128 = {0x00000000000000000000000000000000, 0x00000000000000000000000000000000}}
ymm8           {v8_float = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v4_double = {0x0, 0x0, 0x0, 0x0}, v32_int8 = {0x0 <repeats 32 times>}, v16_int16 = {0x0 <repeats 16 times>}, v8_int32 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v4_int64 = {0x0, 0x0, 0x0, 0x0}, v2_int128 = {0x00000000000000000000000000000000, 0x00000000000000000000000000000000}}
ymm9           {v8_float = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v4_double = {0x0, 0x0, 0x0, 0x0}, v32_int8 = {0x0 <repeats 32 times>}, v16_int16 = {0x0 <repeats 16 times>}, v8_int32 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v4_int64 = {0x0, 0x0, 0x0, 0x0}, v2_int128 = {0x00000000000000000000000000000000, 0x00000000000000000000000000000000}}
ymm10          {v8_float = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v4_double = {0x0, 0x0, 0x0, 0x0}, v32_int8 = {0x0 <repeats 32 times>}, v16_int16 = {0x0 <repeats 16 times>}, v8_int32 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v4_int64 = {0x0, 0x0, 0x0, 0x0}, v2_int128 = {0x00000000000000000000000000000000, 0x00000000000000000000000000000000}}
ymm11          {v8_float = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v4_double = {0x0, 0x0, 0x0, 0x0}, v32_int8 = {0x0 <repeats 32 times>}, v16_int16 = {0x0 <repeats 16 times>}, v8_int32 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v4_int64 = {0x0, 0x0, 0x0, 0x0}, v2_int128 = {0x00000000000000000000000000000000, 0x00000000000000000000000000000000}}
ymm12          {v8_float = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v4_double = {0x0, 0x8000000000000000, 0x0, 0x0}, v32_int8 = {0x0 <repeats 15 times>, 0xff, 0x0 <repeats 16 times>}, v16_int16 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xff00, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v8_int32 = {0x0, 0x0, 0x0, 0xff000000, 0x0, 0x0, 0x0, 0x0}, v4_int64 = {0x0, 0xff00000000000000, 0x0, 0x0}, v2_int128 = {0xff000000000000000000000000000000, 0x00000000000000000000000000000000}}
ymm13          {v8_float = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v4_double = {0x0, 0x0, 0x0, 0x0}, v32_int8 = {0x0 <repeats 32 times>}, v16_int16 = {0x0 <repeats 16 times>}, v8_int32 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v4_int64 = {0x0, 0x0, 0x0, 0x0}, v2_int128 = {0x00000000000000000000000000000000, 0x00000000000000000000000000000000}}
ymm14          {v8_float = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v4_double = {0x0, 0x0, 0x0, 0x0}, v32_int8 = {0x0 <repeats 32 times>}, v16_int16 = {0x0 <repeats 16 times>}, v8_int32 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v4_int64 = {0x0, 0x0, 0x0, 0x0}, v2_int128 = {0x00000000000000000000000000000000, 0x00000000000000000000000000000000}}
ymm15          {v8_float = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v4_double = {0x0, 0x0, 0x0, 0x0}, v32_int8 = {0x0 <repeats 32 times>}, v16_int16 = {0x0 <repeats 16 times>}, v8_int32 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v4_int64 = {0x0, 0x0, 0x0, 0x0}, v2_int128 = {0x00000000000000000000000000000000, 0x00000000000000000000000000000000}}
Dump of assembler code for function disk_geometry:
   0x0000000000403210 <+0>: push   %rbx
   0x0000000000403211 <+1>: mov    %rdi,%rbx
   0x0000000000403214 <+4>: sub    $0xc0,%rsp
   0x000000000040321b <+11>:    movq   $0x0,0x205f9a(%rip)        # 0x6091c0 <g.4372>
   0x0000000000403226 <+22>:    movq   $0x0,0x205f97(%rip)        # 0x6091c8 <g.4372+8>
   0x0000000000403231 <+33>:    movq   $0x0,0x205f94(%rip)        # 0x6091d0 <g.4372+16>
   0x000000000040323c <+44>:    movq   $0x0,0x205f91(%rip)        # 0x6091d8 <g.4372+24>
   0x0000000000403247 <+55>:    lea    0x20(%rsp),%rdx
   0x000000000040324c <+60>:    mov    (%rdi),%rsi
   0x000000000040324f <+63>:    mov    $0x1,%edi
   0x0000000000403254 <+68>:    mov    %fs:0x28,%rax
   0x000000000040325d <+77>:    mov    %rax,0xb8(%rsp)
   0x0000000000403265 <+85>:    xor    %eax,%eax
   0x0000000000403267 <+87>:    callq  0x400f80 <__xstat@plt>
   0x000000000040326c <+92>:    test   %eax,%eax
   0x000000000040326e <+94>:    jne    0x403284 <disk_geometry+116>
   0x0000000000403270 <+96>:    mov    0x38(%rsp),%eax
   0x0000000000403274 <+100>:   and    $0xf000,%eax
   0x0000000000403279 <+105>:   cmp    $0x8000,%eax
   0x000000000040327e <+110>:   je     0x403320 <disk_geometry+272>
   0x0000000000403284 <+116>:   mov    0x8(%rbx),%edi
   0x0000000000403287 <+119>:   lea    0x10(%rsp),%rdx
   0x000000000040328c <+124>:   xor    %eax,%eax
   0x000000000040328e <+126>:   mov    $0x301,%esi
   0x0000000000403293 <+131>:   callq  0x400ed0 <ioctl@plt>
   0x0000000000403298 <+136>:   cmp    $0xffffffff,%eax
   0x000000000040329b <+139>:   je     0x403400 <disk_geometry+496>
   0x00000000004032a1 <+145>:   mov    0x8(%rbx),%edi
   0x00000000004032a4 <+148>:   lea    0x8(%rsp),%rdx
   0x00000000004032a9 <+153>:   xor    %eax,%eax
   0x00000000004032ab <+155>:   mov    $0x1260,%esi
   0x00000000004032b0 <+160>:   callq  0x400ed0 <ioctl@plt>
   0x00000000004032b5 <+165>:   cmp    $0xffffffff,%eax
   0x00000000004032b8 <+168>:   je     0x403430 <disk_geometry+544>
   0x00000000004032be <+174>:   movzbl 0x10(%rsp),%esi
   0x00000000004032c3 <+179>:   movzbl 0x11(%rsp),%ecx
   0x00000000004032c8 <+184>:   mov    0x8(%rsp),%rax
   0x00000000004032cd <+189>:   movzbl %cl,%edi
   0x00000000004032d0 <+192>:   movzbl %sil,%edx
   0x00000000004032d4 <+196>:   mov    %rax,0x205efd(%rip)        # 0x6091d8 <g.4372+24>
   0x00000000004032db <+203>:   imul   %edi,%edx
   0x00000000004032de <+206>:   mov    %rsi,0x205ee3(%rip)        # 0x6091c8 <g.4372+8>
   0x00000000004032e5 <+213>:   mov    %rcx,0x205ee4(%rip)        # 0x6091d0 <g.4372+16>
   0x00000000004032ec <+220>:   movslq %edx,%rdi
   0x00000000004032ef <+223>:   xor    %edx,%edx
=> 0x00000000004032f1 <+225>:   div    %rdi
   0x00000000004032f4 <+228>:   mov    %rax,0x205ec5(%rip)        # 0x6091c0 <g.4372>
   0x00000000004032fb <+235>:   mov    0xb8(%rsp),%rbx
   0x0000000000403303 <+243>:   xor    %fs:0x28,%rbx
   0x000000000040330c <+252>:   mov    $0x6091c0,%eax
   0x0000000000403311 <+257>:   jne    0x40345a <disk_geometry+586>
   0x0000000000403317 <+263>:   add    $0xc0,%rsp
   0x000000000040331e <+270>:   pop    %rbx
   0x000000000040331f <+271>:   retq   
   0x0000000000403320 <+272>:   mov    0x50(%rsp),%rax
   0x0000000000403325 <+277>:   lea    0x1ff(%rax),%rdx
   0x000000000040332c <+284>:   test   %rax,%rax
   0x000000000040332f <+287>:   cmovs  %rdx,%rax
   0x0000000000403333 <+291>:   sar    $0x9,%rax
   0x0000000000403337 <+295>:   test   %rax,%rax
   0x000000000040333a <+298>:   mov    %rax,0x8(%rsp)
   0x000000000040333f <+303>:   mov    %rax,%rdi
   0x0000000000403342 <+306>:   jne    0x40335d <disk_geometry+333>
   0x0000000000403344 <+308>:   mov    $0x1,%dil
   0x0000000000403347 <+311>:   mov    $0x4061d0,%edx
   0x000000000040334c <+316>:   mov    $0x4061ee,%esi
   0x0000000000403351 <+321>:   xor    %eax,%eax
   0x0000000000403353 <+323>:   callq  0x405230 <pr>
   0x0000000000403358 <+328>:   mov    0x8(%rsp),%rdi
   0x000000000040335d <+333>:   lea    -0x1(%rdi),%rsi
   0x0000000000403361 <+337>:   movabs $0x410410410410411,%rdx
   0x000000000040336b <+347>:   mov    %rdi,0x205e66(%rip)        # 0x6091d8 <g.4372+24>
   0x0000000000403372 <+354>:   mov    %rsi,%rax
   0x0000000000403375 <+357>:   mul    %rdx
   0x0000000000403378 <+360>:   mov    %rsi,%rax
   0x000000000040337b <+363>:   sub    %rdx,%rax
   0x000000000040337e <+366>:   shr    %rax
   0x0000000000403381 <+369>:   lea    (%rdx,%rax,1),%rcx
   0x0000000000403385 <+373>:   movabs $0x8080808080808081,%rdx
   0x000000000040338f <+383>:   shr    $0x5,%rcx
   0x0000000000403393 <+387>:   mov    %rcx,%rax
   0x0000000000403396 <+390>:   mov    %rcx,%rbx
   0x0000000000403399 <+393>:   mul    %rdx
   0x000000000040339c <+396>:   shr    $0x7,%rdx
   0x00000000004033a0 <+400>:   mov    %rdx,%rax
   0x00000000004033a3 <+403>:   shl    $0x8,%rax
   0x00000000004033a7 <+407>:   sub    %rdx,%rax
   0x00000000004033aa <+410>:   movabs $0x515565a6aabafc1,%rdx
   0x00000000004033b4 <+420>:   sub    %rax,%rbx
   0x00000000004033b7 <+423>:   mov    %rcx,%rax
   0x00000000004033ba <+426>:   shl    $0x6,%rax
   0x00000000004033be <+430>:   mov    %rbx,0x205e03(%rip)        # 0x6091c8 <g.4372+8>
   0x00000000004033c5 <+437>:   mov    %rsi,%rbx
   0x00000000004033c8 <+440>:   sub    %rcx,%rax
   0x00000000004033cb <+443>:   sub    %rax,%rbx
   0x00000000004033ce <+446>:   mov    %rbx,%rax
   0x00000000004033d1 <+449>:   add    $0x1,%rax
   0x00000000004033d5 <+453>:   mov    %rax,0x205df4(%rip)        # 0x6091d0 <g.4372+16>
   0x00000000004033dc <+460>:   mov    %rsi,%rax
   0x00000000004033df <+463>:   mul    %rdx
   0x00000000004033e2 <+466>:   sub    %rdx,%rsi
   0x00000000004033e5 <+469>:   shr    %rsi
   0x00000000004033e8 <+472>:   add    %rdx,%rsi
   0x00000000004033eb <+475>:   shr    $0xd,%rsi
   0x00000000004033ef <+479>:   mov    %rsi,0x205dca(%rip)        # 0x6091c0 <g.4372>
   0x00000000004033f6 <+486>:   jmpq   0x4032fb <disk_geometry+235>
   0x00000000004033fb <+491>:   nopl   0x0(%rax,%rax,1)
   0x0000000000403400 <+496>:   callq  0x400e30 <__errno_location@plt>
   0x0000000000403405 <+501>:   mov    (%rax),%edi
   0x0000000000403407 <+503>:   callq  0x401050 <strerror@plt>
   0x000000000040340c <+508>:   mov    $0x406205,%edx
   0x0000000000403411 <+513>:   mov    %rax,%rcx
   0x0000000000403414 <+516>:   mov    $0x406211,%esi
   0x0000000000403419 <+521>:   mov    $0x1,%edi
   0x000000000040341e <+526>:   xor    %eax,%eax
   0x0000000000403420 <+528>:   callq  0x405230 <pr>
   0x0000000000403425 <+533>:   jmpq   0x4032a1 <disk_geometry+145>
   0x000000000040342a <+538>:   nopw   0x0(%rax,%rax,1)
   0x0000000000403430 <+544>:   callq  0x400e30 <__errno_location@plt>
   0x0000000000403435 <+549>:   mov    (%rax),%edi
   0x0000000000403437 <+551>:   callq  0x401050 <strerror@plt>
   0x000000000040343c <+556>:   mov    $0x406226,%edx
   0x0000000000403441 <+561>:   mov    %rax,%rcx
   0x0000000000403444 <+564>:   mov    $0x406211,%esi
   0x0000000000403449 <+569>:   mov    $0x1,%edi
   0x000000000040344e <+574>:   xor    %eax,%eax
   0x0000000000403450 <+576>:   callq  0x405230 <pr>
   0x0000000000403455 <+581>:   jmpq   0x4032be <disk_geometry+174>
   0x000000000040345a <+586>:   callq  0x400e80 <__stack_chk_fail@plt>
End of assembler dump.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.