wok-6.x diff linld/stuff/load.u @ rev 19204

linld/tobzimage: add realmode_switch support (again)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sat Jun 11 20:26:42 2016 +0200 (2016-06-11)
parents df58e6c974a3
children 8c67051bb198
line diff
     1.1 --- a/linld/stuff/load.u	Thu Jul 23 09:44:18 2015 +0200
     1.2 +++ b/linld/stuff/load.u	Sat Jun 11 20:26:42 2016 +0200
     1.3 @@ -5,15 +5,15 @@
     1.4       if(first1k->boot_flag != 0xAA55)
     1.5           die("No boot signature (55,AA). It's not a kernel");
     1.6  -    if(first1k->header != HdrS)
     1.7 -+    if(first1k->header != HdrS) // starting linux 1.3.73
     1.8  -        die("No 'HdrS' signature (kernel is too old)");
     1.9 -+        die("No 'HdrS' signature (kernel is too old, try /usr/bin/tobzimage)");
    1.10  -    if(first1k->version < 0x202)
    1.11  -        die("Loader protocol version is less than 2.02 (kernel is too old)");
    1.12 ++    if(first1k->header != HdrS) // starting linux 1.3.73
    1.13 ++        die("No 'HdrS' signature (kernel is too old, try /usr/bin/tobzimage)");
    1.14       if(!(first1k->loadflags & 0x01))
    1.15           die("I can't load bzImages low");
    1.16   
    1.17 -@@ -414,7 +412,13 @@
    1.18 +@@ -414,15 +412,23 @@
    1.19       // Tell rm loader some info
    1.20   
    1.21       first1k->vid_mode = vid_mode;
    1.22 @@ -28,3 +28,17 @@
    1.23       first1k->type_of_loader = 0xff; // kernel do not know us (yet :-)
    1.24       // * will be called just before rm -> pm
    1.25       first1k->realmode_switch_ofs = ofs(last_ditch);
    1.26 +     first1k->realmode_switch_seg = seg(last_ditch);
    1.27 +-    // * offset limit of the setup heap
    1.28 +-    //   heap_end_ptr appears to be relative to the start of setup (ofs 0x0200)
    1.29 +-    first1k->heap_end_ptr = _32k-0x0200;
    1.30 +-    first1k->loadflags |= 0x80; // says to rm loader it's ok to use heap
    1.31 ++    if(first1k->version >= 0x201) {
    1.32 ++        // * offset limit of the setup heap
    1.33 ++        //   heap_end_ptr appears to be relative to the start of setup (ofs 0x0200)
    1.34 ++        first1k->heap_end_ptr = _32k-0x0200;
    1.35 ++        first1k->loadflags |= 0x80; // says to rm loader it's ok to use heap
    1.36 ++    }
    1.37 +     // * if we will ever stop moving ourself to 0x90000
    1.38 +     //   we must say setup.S how much to move
    1.39 +     //first1k->setup_move_size = _32k;