allowing any space for this, which makes it surprising that bzImage
loading ever worked.
/* Prepare for exiting */
shutdown();
/* Prepare for exiting */
shutdown();
+ DBGC ( image, "bzImage %p jumping to RM kernel at %04x:0000 "
+ "(stack %04x:%04x)\n", image,
+ ( exec_ctx.rm_kernel_seg + 0x20 ),
+ exec_ctx.rm_kernel_seg, exec_ctx.rm_heap );
+
/* Jump to the kernel */
__asm__ __volatile__ ( REAL_CODE ( "movw %w0, %%ds\n\t"
"movw %w0, %%es\n\t"
/* Jump to the kernel */
__asm__ __volatile__ ( REAL_CODE ( "movw %w0, %%ds\n\t"
"movw %w0, %%es\n\t"
/* Calculate load address and size of real-mode portion */
load_ctx->rm_kernel_seg = 0x1000; /* place RM kernel at 1000:0000 */
load_ctx->rm_kernel = real_to_user ( load_ctx->rm_kernel_seg, 0 );
/* Calculate load address and size of real-mode portion */
load_ctx->rm_kernel_seg = 0x1000; /* place RM kernel at 1000:0000 */
load_ctx->rm_kernel = real_to_user ( load_ctx->rm_kernel_seg, 0 );
- load_ctx->rm_filesz = load_ctx->rm_memsz =
( ( bzhdr->setup_sects ? bzhdr->setup_sects : 4 ) + 1 ) << 9;
( ( bzhdr->setup_sects ? bzhdr->setup_sects : 4 ) + 1 ) << 9;
+ load_ctx->rm_memsz = BZI_ASSUMED_RM_SIZE;
if ( load_ctx->rm_filesz > image->len ) {
DBGC ( image, "bzImage %p too short for %zd byte of setup\n",
image, load_ctx->rm_filesz );
if ( load_ctx->rm_filesz > image->len ) {
DBGC ( image, "bzImage %p too short for %zd byte of setup\n",
image, load_ctx->rm_filesz );
/** bzImage command line present magic marker value */
#define BZI_CMDLINE_MAGIC 0xa33f
/** bzImage command line present magic marker value */
#define BZI_CMDLINE_MAGIC 0xa33f
+/** Assumed size of real-mode portion (including .bss) */
+#define BZI_ASSUMED_RM_SIZE 0x8000
/** Amount of stack space to provide */
#define BZI_STACK_SIZE 0x1000
/** Amount of stack space to provide */
#define BZI_STACK_SIZE 0x1000