File: 1tib_disk_limit.diff

package info (click to toggle)
grub 0.97-27etch1
  • links: PTS
  • area: main
  • in suites: etch
  • size: 4,576 kB
  • ctags: 8,866
  • sloc: ansic: 38,787; sh: 5,559; asm: 2,014; makefile: 652; perl: 338
file content (134 lines) | stat: -rw-r--r-- 4,876 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134

Author: Robert Millan
Description: Surpass 128 GiB limit.

diff -ur -x .deps -x Makefile -x config.log -x config.status -x 00list -x docs -x configure ../grub-0.97/grub/asmstub.c ./grub/asmstub.c
--- ../grub-0.97/grub/asmstub.c	2008-03-19 16:25:34.000000000 -0400
+++ ./grub/asmstub.c	2008-03-19 21:06:33.000000000 -0400
@@ -984,7 +984,7 @@
 
 int
 biosdisk (int subfunc, int drive, struct geometry *geometry,
-	  int sector, int nsec, int segment)
+	  unsigned int sector, int nsec, int segment)
 {
   char *buf;
   int fd = geometry->flags;
diff -ur -x .deps -x Makefile -x config.log -x config.status -x 00list -x docs -x configure ../grub-0.97/lib/device.c ./lib/device.c
--- ../grub-0.97/lib/device.c	2008-03-19 16:25:34.000000000 -0400
+++ ./lib/device.c	2008-03-19 21:06:33.000000000 -0400
@@ -69,9 +69,7 @@
 # ifndef CDROM_GET_CAPABILITY
 #  define CDROM_GET_CAPABILITY	0x5331	/* get capabilities */
 # endif /* ! CDROM_GET_CAPABILITY */
-# ifndef BLKGETSIZE
-#  define BLKGETSIZE	_IO(0x12,96)	/* return device size */
-# endif /* ! BLKGETSIZE */
+# include <sys/mount.h> /* BLKGETSIZE64 */
 #endif /* __linux__ */
 
 /* Use __FreeBSD_kernel__ instead of __FreeBSD__ for compatibility with
@@ -297,13 +295,13 @@
 #if defined(__linux__)
   /* Linux */
   {
-    unsigned long nr;
+    unsigned long long nr;
 
-    if (ioctl (fd, BLKGETSIZE, &nr))
+    if (ioctl (fd, BLKGETSIZE64, &nr))
       goto fail;
     
     /* Got the geometry, so save it. */
-    geom->total_sectors = nr;
+    geom->total_sectors = nr / 512;
     get_linux_geometry(fd, geom);
     if (!geom->heads && !geom->cylinders && !geom->sectors)
         goto fail;
diff -ur -x .deps -x Makefile -x config.log -x config.status -x 00list -x docs -x configure ../grub-0.97/stage2/bios.c ./stage2/bios.c
--- ../grub-0.97/stage2/bios.c	2004-03-27 11:34:04.000000000 -0500
+++ ./stage2/bios.c	2008-03-19 21:06:33.000000000 -0400
@@ -47,7 +47,7 @@
    return the error number. Otherwise, return 0.  */
 int
 biosdisk (int read, int drive, struct geometry *geometry,
-	  int sector, int nsec, int segment)
+	  unsigned int sector, int nsec, int segment)
 {
   int err;
   
diff -ur -x .deps -x Makefile -x config.log -x config.status -x 00list -x docs -x configure ../grub-0.97/stage2/disk_io.c ./stage2/disk_io.c
--- ../grub-0.97/stage2/disk_io.c	2004-05-23 12:35:24.000000000 -0400
+++ ./stage2/disk_io.c	2008-03-19 21:06:33.000000000 -0400
@@ -137,7 +137,7 @@
 }
 
 int
-rawread (int drive, int sector, int byte_offset, int byte_len, char *buf)
+rawread (int drive, unsigned int sector, int byte_offset, int byte_len, char *buf)
 {
   int slen, sectors_per_vtrack;
   int sector_size_bits = log2 (buf_geom.sector_size);
@@ -261,7 +261,7 @@
        */
       if (disk_read_func)
 	{
-	  int sector_num = sector;
+	  unsigned int sector_num = sector;
 	  int length = buf_geom.sector_size - byte_offset;
 	  if (length > size)
 	    length = size;
@@ -291,7 +291,7 @@
 
 
 int
-devread (int sector, int byte_offset, int byte_len, char *buf)
+devread (unsigned int sector, int byte_offset, int byte_len, char *buf)
 {
   /*
    *  Check partition boundaries
@@ -330,7 +330,7 @@
 
 #ifndef STAGE1_5
 int
-rawwrite (int drive, int sector, char *buf)
+rawwrite (int drive, unsigned int sector, char *buf)
 {
   if (sector == 0)
     {
@@ -363,7 +363,7 @@
 }
 
 int
-devwrite (int sector, int sector_count, char *buf)
+devwrite (unsigned int sector, int sector_count, char *buf)
 {
 #if defined(GRUB_UTIL) && defined(__linux__)
   if (current_partition != 0xFFFFFF
diff -ur -x .deps -x Makefile -x config.log -x config.status -x 00list -x docs -x configure ../grub-0.97/stage2/shared.h ./stage2/shared.h
--- ../grub-0.97/stage2/shared.h	2008-03-19 16:25:34.000000000 -0400
+++ ./stage2/shared.h	2008-03-19 21:06:33.000000000 -0400
@@ -816,7 +816,7 @@
 /* Low-level disk I/O */
 int get_diskinfo (int drive, struct geometry *geometry);
 int biosdisk (int subfunc, int drive, struct geometry *geometry,
-	      int sector, int nsec, int segment);
+	      unsigned int sector, int nsec, int segment);
 void stop_floppy (void);
 
 /* Command-line interface functions. */
@@ -930,10 +930,10 @@
 int gunzip_read (char *buf, int len);
 #endif /* NO_DECOMPRESSION */
 
-int rawread (int drive, int sector, int byte_offset, int byte_len, char *buf);
-int devread (int sector, int byte_offset, int byte_len, char *buf);
-int rawwrite (int drive, int sector, char *buf);
-int devwrite (int sector, int sector_len, char *buf);
+int rawread (int drive, unsigned int sector, int byte_offset, int byte_len, char *buf);
+int devread (unsigned int sector, int byte_offset, int byte_len, char *buf);
+int rawwrite (int drive, unsigned int sector, char *buf);
+int devwrite (unsigned int sector, int sector_len, char *buf);
 
 /* Parse a device string and initialize the global parameters. */
 char *set_device (char *device);