lkml.org 
[lkml]   [1999]   [Oct]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectbzImage kernels > 1M in size
Hi there.

Enclosed is a patch that provides the first stage of the procedure
required to successfully compile kernels with bzImage where the
compressed kernel image is greater than 1M in size. However, one
should note that this is only the first stage of the relevant
procedure.

This stage implements the relevant tweaks to build.c to allow suchlike
kernels to be built, and causes the warning that suchlike kernels
currently can not be booted from the in-built boot loader to be
issued, but does not prevent the build procedure from completing.

It also implements the necessary changes to the parameters table at
the end of bootsect.S ready for the tweaks to the boot sector to allow
it to boot suchlike kernels, and correctly specifies the maximum size
of the bzImage format kernel image as being 15 Megabytes, which is the
limit imposed by the BIOS routine used to load suchlike kernels on the
i386 architecture.

I had done a lot more work on this patch, but lost the results with a
CPU failure last week that killed my hard disk in the process. I am
therefore reworking this from scratch.

Best wishes from Riley.

PS: The kernel versions page is now back online at the URL below.

+----------------------------------------------------------------------+
| There is something frustrating about the quality and speed of Linux |
| development, ie., the quality is too high and the speed is too high, |
| in other words, I can implement this XXXX feature, but I bet someone |
| else has already done so and is just about to release their patch. |
+----------------------------------------------------------------------+
* http://www.memalpha.cx/Linux/Kernel/
--- linux-2.2.12/arch/i386/boot/bootsect.S~ Wed Jun 24 22:30:08 1998
+++ linux-2.2.12/arch/i386/boot/bootsect.S Thu Oct 14 11:48:03 1999
@@ -201,7 +201,7 @@
xor bh,bh
int 0x10

- mov cx,#9
+ mov cx,#msg1end - msg1
mov bx,#0x0007 ! page 0, attribute 7 (normal)
mov bp,#msg1
mov ax,#0x1301 ! write string, move cursor
@@ -444,14 +444,19 @@
msg1:
.byte 13,10
.ascii "Loading"
+msg1end:

-.org 497
+.org 492
+syssize:
+ .long SYSSIZE
+unused:
+ .byte 0
setup_sects:
.byte SETUPSECS
root_flags:
.word CONFIG_ROOT_RDONLY
-syssize:
- .word SYSSIZE
+reserved:
+ .word 0xFFFF
swap_dev:
.word SWAP_DEV
ram_size:
--- linux-2.2.12/arch/i386/boot/tools/build.c~ Sun Oct 25 22:16:21 1998
+++ linux-2.2.12/arch/i386/boot/tools/build.c Thu Oct 14 16:50:13 1999
@@ -93,6 +93,8 @@
byte major_root, minor_root;
struct stat sb;

+ fprintf(stderr, "\nBuilding boot image.\n" );
+
if (argc > 2 && !strcmp(argv[1], "-b"))
{
is_big_kernel = 1;
@@ -168,9 +170,22 @@
sz = sb.st_size;
fprintf (stderr, "System is %d kB\n", sz/1024);
sys_size = (sz + 15) / 16;
- if (sys_size > (is_big_kernel ? 0xffff : DEF_SYSSIZE))
- die("System is too big. Try using %smodules.",
- is_big_kernel ? "" : "bzImage or ");
+ if (is_big_kernel) {
+ if (sys_size > 0xffff) {
+ if (sys_size > 0xeffff) {
+ die("System is too big (Max 15 MB). Try using modules.");
+ } else {
+ fprintf(stderr, "WARNING: This kernel image is greater than 1MB in size.\n"
+ " This system will compile, but can NOT be booted using the in-built\n"
+ " boot loader. You will need to use LILO, SysLinux or a similar boot\n"
+ " loader instead, or make more use of modules.\n");
+ }
+ }
+ } else {
+ if (sys_size > DEF_SYSSIZE)
+ die("System is too big (Max %u kb). Try using bzImage or modules.",
+ DEF_SYSSIZE >> 6);
+ }
while (sz > 0) {
int l, n;

@@ -199,5 +214,6 @@
if (write(1, buf, 2) != 2)
die("Write of image length failed");

- return 0; /* Everything is OK */
+ fprintf(stderr, "Build complete.\n"); /* Everything is OK */
+ return 0;
}
\
 
 \ /
  Last update: 2005-03-22 13:54    [W:0.028 / U:1.836 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site