Changeset 4350

Show
Ignore:
Timestamp:
06/07/09 16:38:32 (9 months ago)
Author:
uwe
Message:

A bunch of additional EPIA-M700 cleanups and also some non-cosmetic changes:

  • Make get_dsdt script executable.
  • Set proper IRQ_SLOT_COUNT value in the hope that the '14' from irq_table.c is correct.
  • Fix broken or incorrect #include names to increase likelyhood of a successful compile.


Signed-off-by: Uwe Hermann <uwe@…>
Acked-by: Uwe Hermann <uwe@…>

Location:
trunk/coreboot-v2/src/mainboard/via/epia-m700
Files:
6 modified
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/coreboot-v2/src/mainboard/via/epia-m700/Options.lb

    r4349 r4350  
    121121default HAVE_HARD_RESET = 0 
    122122default HAVE_PIRQ_TABLE = 0 
    123 default IRQ_SLOT_COUNT = 10     # FIXME. irq_table.c says 14. 
     123default IRQ_SLOT_COUNT = 14 
    124124default HAVE_ACPI_TABLES = 1 
    125125default HAVE_OPTION_TABLE = 1 
  • trunk/coreboot-v2/src/mainboard/via/epia-m700/cache_as_ram_auto.c

    r4349 r4350  
    4949 
    5050/* This file contains the board-special SI value for raminit.c. */ 
    51 #include "mainboard/via/6413e/DrivingClkPhaseData.c" 
     51#include "driving_clk_phase_data.c" 
    5252 
    5353#include "northbridge/via/vx800/raminit.h" 
    5454#include "northbridge/via/vx800/raminit.c" 
    5555#include "cpu/x86/car/copy_and_run.c" 
    56 #include "mainboard/via/6413e/wakeup.h" 
     56#include "wakeup.h" 
    5757 
    5858/* 
     
    218218        0x00, 0xFF, NB_APIC_REG(0x61), 0xFF, 0x0E,      // Set Exxxxxxx as pcie mmio config range 
    219219        0x00, 0xFF, NB_APIC_REG(0x60), 0xF4, 0x0B,      // Support extended cfg address of pcie 
    220         //0x00, 0xFF, NB_APIC_REG(0x42), 0xF9, 0x02, // APIC Interrupt((BT_INTR)) Control 
     220        // 0x00, 0xFF, NB_APIC_REG(0x42), 0xF9, 0x02, // APIC Interrupt((BT_INTR)) Control 
    221221        // Set ROMSIP value by software 
    222222 
     
    249249        0x00, 0xFF, NB_HOST_REG(0x85), 0xFF, 0x44, // Host Data / Strobe CKG Control (Group 1) 
    250250        0x00, 0xFF, NB_HOST_REG(0x86), 0xFF, 0x44, // Host Data / Strobe CKG Control (Group 2) 
    251         0x00, 0xFF, NB_HOST_REG(0x87), 0xFF, 0x44, // Host Data / Strobe CKG Control (Group 3) */ 
     251        0x00, 0xFF, NB_HOST_REG(0x87), 0xFF, 0x44, // Host Data / Strobe CKG Control (Group 3) 
     252        */ 
    252253 
    253254        // CPU Host Bus Control 
    254255        0x00, 0xFF, NB_HOST_REG(0x50), 0x1F, 0x08,      // Request phase ctrl: Dynamic Defer Snoop Stall Count = 8 
    255         //0x00, 0xFF, NB_HOST_REG(0x51), 0xFF, 0x7F, // CPU I/F Ctrl-1: Disable Fast DRDY and RAW 
     256        // 0x00, 0xFF, NB_HOST_REG(0x51), 0xFF, 0x7F,   // CPU I/F Ctrl-1: Disable Fast DRDY and RAW 
    256257        0x00, 0xFF, NB_HOST_REG(0x51), 0xFF, 0x7C,      // CPU I/F Ctrl-1: Disable Fast DRDY and RAW 
    257258        0x00, 0xFF, NB_HOST_REG(0x52), 0xCB, 0xCB,      // CPU I/F Ctrl-2: Enable all for performance 
    258         //0x00, 0xFF, NB_HOST_REG(0x53), 0xFF, 0x88, // Arbitration: Host/Master Occupancy timer = 8*4 HCLK 
     259        // 0x00, 0xFF, NB_HOST_REG(0x53), 0xFF, 0x88,   // Arbitration: Host/Master Occupancy timer = 8*4 HCLK 
    259260        0x00, 0xFF, NB_HOST_REG(0x53), 0xFF, 0x44,      // Arbitration: Host/Master Occupancy timer = 4*4 HCLK 
    260261        0x00, 0xFF, NB_HOST_REG(0x54), 0x1E, 0x1C,      // Misc Ctrl: Enable 8QW burst Mem Access 
    261         //0x00, 0xFF, NB_HOST_REG(0x55), 0x06, 0x06, // Miscellaneous Control 2 
     262        // 0x00, 0xFF, NB_HOST_REG(0x55), 0x06, 0x06,   // Miscellaneous Control 2 
    262263        0x00, 0xFF, NB_HOST_REG(0x55), 0x06, 0x04,      // Miscellaneous Control 2 
    263264        0x00, 0xFF, NB_HOST_REG(0x56), 0xF7, 0x63,      // Write Policy 1 
    264         //0x00, 0xFF, NB_HOST_REG(0x59), 0x3D, 0x01, // CPU Miscellaneous Control 1, enable Lowest-Priority IPL 
    265         //0x00, 0xFF, NB_HOST_REG(0x5c), 0xFF, 0x00, // CPU Miscellaneous Control 2 
     265        // 0x00, 0xFF, NB_HOST_REG(0x59), 0x3D, 0x01,   // CPU Miscellaneous Control 1, enable Lowest-Priority IPL 
     266        // 0x00, 0xFF, NB_HOST_REG(0x5c), 0xFF, 0x00,   // CPU Miscellaneous Control 2 
    266267        0x00, 0xFF, NB_HOST_REG(0x5D), 0xFF, 0xA2,      // Write Policy 
    267268        0x00, 0xFF, NB_HOST_REG(0x5E), 0xFF, 0x88,      // Bandwidth Timer 
    268269        0x00, 0xFF, NB_HOST_REG(0x5F), 0x46, 0x46,      // CPU Misc Ctrl 
    269         // 0x00, 0xFF, NB_HOST_REG(0x90), 0xFF, 0x0B, // CPU Miscellaneous Control 3 
    270         //0x00, 0xFF, NB_HOST_REG(0x96), 0x0B, 0x0B, // CPU Miscellaneous Control 2 
     270        // 0x00, 0xFF, NB_HOST_REG(0x90), 0xFF, 0x0B,   // CPU Miscellaneous Control 3 
     271        // 0x00, 0xFF, NB_HOST_REG(0x96), 0x0B, 0x0B,   // CPU Miscellaneous Control 2 
    271272        0x00, 0xFF, NB_HOST_REG(0x96), 0x0B, 0x0A,      // CPU Miscellaneous Control 2 
    272273        0x00, 0xFF, NB_HOST_REG(0x98), 0xC1, 0x41,      // CPU Miscellaneous Control 3 
     
    286287#define gCom2Base   0x2f8 
    287288 
    288 void EmbedComInit() 
     289void EmbedComInit(void) 
    289290{ 
    290291        u8 ByteVal; 
     
    352353//noharddrive 
    353354 
    354         /* Set embedded COM1 I/O base = 0x3E8 */ 
    355         //D17F0RB4 
    356         //ByteVal = 0xFD; 
     355        /* Set embedded COM1 I/O base = 0x3E8 (D17F0RB4, ByteVal = 0xFD) */ 
    357356        if (USE_COM1 == 1) { 
    358357                ByteVal = (u8) ((gCom1Base >> 3) | 0x80); 
     
    363362        } 
    364363 
    365         /* Set embedded COM2 I/O base = 0x2E8. */ 
    366         //D17F0RB5 
    367         //ByteVal = 0xDD; 
     364        /* Set embedded COM2 I/O base = 0x2E8 (D17F0RB5, ByteVal = 0xDD). */ 
    368365        if (USE_COM2 == 1) { 
    369366                ByteVal = (u8) ((gCom2Base >> 3) | 0x80); 
  • trunk/coreboot-v2/src/mainboard/via/epia-m700/driving_clk_phase_data.c

    r4349 r4350  
    1919 */ 
    2020 
    21 #include "northbridge/via/vx800/DrivingClkPhaseData.h" 
     21#include "northbridge/via/vx800/driving_clk_phase_data.h" 
    2222 
    2323// DQS Driving 
  • trunk/coreboot-v2/src/mainboard/via/epia-m700/fadt.c

    r4349 r4350  
    2424#include <../../../northbridge/via/vx800/vx800.h> 
    2525 
    26 void acpi_create_fadt(acpi_fadt_t * fadt, acpi_facs_t * facs, void *dsdt) 
     26void acpi_create_fadt(acpi_fadt_t *fadt, acpi_facs_t *facs, void *dsdt) 
    2727{ 
    2828        acpi_header_t *header = &(fadt->header); 
  • trunk/coreboot-v2/src/mainboard/via/epia-m700/get_dsdt

    • Property svn:executable set to *
  • trunk/coreboot-v2/src/mainboard/via/epia-m700/irq_tables.c

    r4349 r4350  
    2424        PIRQ_SIGNATURE,         /* u32 signature */ 
    2525        PIRQ_VERSION,           /* u16 version   */ 
    26         32 + 16 * 14,           /* There can be total 14 devices on the bus */ 
     26        32 + 16 * IRQ_SLOT_COUNT,/* Max. number of devices on the bus */ 
    2727        0x00,                   /* Where the interrupt router lies (bus) */ 
    2828        (0x11 << 3) | 0x0,      /* Where the interrupt router lies (dev) */ 
  • trunk/coreboot-v2/src/mainboard/via/epia-m700/wakeup.c

    r4349 r4350  
    2020 */ 
    2121 
    22 /* reboot.c from Linux. */ 
     22/* Parts of this code is taken from reboot.c from Linux. */ 
    2323 
    2424/* 
     
    5858} __attribute__ ((packed)); 
    5959 
    60 static struct Xgt_desc_struct 
    61     real_mode_gdt = 
    62     { sizeof(real_mode_gdt_entries) - 1, (long)real_mode_gdt_entries }, 
    63     real_mode_idt = { 
    64 0x3ff, 0}, no_idt = { 
    65 0, 0}; 
     60static struct Xgt_desc_struct real_mode_gdt = { 
     61        sizeof(real_mode_gdt_entries) - 1, 
     62        (long)real_mode_gdt_entries 
     63}, 
     64real_mode_idt = {0x3ff, 0}, 
     65no_idt = { 0, 0 }; 
    6666 
    6767/* 
     
    8686 */ 
    8787 
    88 //      0x66, 0x0d, 0x00, 0x00, 0x00, 0x60,     /*    orl   $0x60000000,%eax */ 
     88//      0x66, 0x0d, 0x00, 0x00, 0x00, 0x60,     /* orl $0x60000000, %eax */ 
    8989 
    9090static unsigned char real_mode_switch[] = { 
    91         0x66, 0x0f, 0x20, 0xc0, /* movl %cr0,%eax */ 
    92         0x24, 0xfe,             /* andb $0xfe,al */ 
    93         0x66, 0x0f, 0x22, 0xc0  /* movl %eax,%cr0 */ 
     91        0x66, 0x0f, 0x20, 0xc0,                 /* movl %cr0,%eax */ 
     92        0x24, 0xfe,                             /* andb $0xfe,al */ 
     93        0x66, 0x0f, 0x22, 0xc0                  /* movl %eax,%cr0 */ 
    9494}; 
    9595 
    9696static unsigned char jump_to_wakeup[] = { 
    97         0xea, 0x00, 0x00, 0x00, 0xe0 /* ljmp $0xffff, $0x0000 */ 
     97        0xea, 0x00, 0x00, 0x00, 0xe0            /* ljmp $0xffff, $0x0000 */ 
    9898}; 
    9999 
     
    104104 */ 
    105105static unsigned char show31[6] = { 
    106         0xb0, 0x31, 0xe6, 0x80, 0xeb, 0xFA      /*    ljmp  $0xffff,$0x0000 */ 
     106        0xb0, 0x31, 0xe6, 0x80, 0xeb, 0xFA      /* ljmp $0xffff, $0x0000 */ 
    107107}; 
    108108 
    109109static unsigned char show32[6] = { 
    110         0xb0, 0x32, 0xe6, 0x80, 0xeb, 0xFA      /*    ljmp  $0xffff,$0x0000 */ 
     110        0xb0, 0x32, 0xe6, 0x80, 0xeb, 0xFA      /* ljmp $0xffff, $0x0000 */ 
    111111}; 
    112112 
    113113void acpi_jump_wake(u32 vector) 
    114114{ 
    115         u32 tmp; 
     115        u32 tmp, dwEip; 
    116116        u16 tmpvector; 
    117         u32 dwEip; 
    118117        u8 Data; 
    119118        struct Xgt_desc_struct *wake_thunk16_Xgt_desc; 
     
    138137 
    139138        unsigned long long *real_mode_gdt_entries_at_eseg; 
    140         real_mode_gdt_entries_at_eseg = WAKE_THUNK16_GDT;       //copy from real_mode_gdt_entries and change limition to 1M and data base to 0; 
     139        real_mode_gdt_entries_at_eseg = WAKE_THUNK16_GDT;               /* Copy from real_mode_gdt_entries and change limition to 1M and data base to 0; */ 
    141140        real_mode_gdt_entries_at_eseg[0] = 0x0000000000000000ULL;       /* Null descriptor */ 
    142141        real_mode_gdt_entries_at_eseg[1] = 0x000f9a000000ffffULL;       /* 16-bit real-mode 1M code at 0x00000000 */ 
     
    151150        wake_thunk16_Xgt_desc[2].address = 0; 
    152151 
    153         /*added this code to get current value of EIP 
    154          */ 
    155         __asm__ volatile ("calll   geip\n\t" 
    156                           "geip: \n\t" "popl %0\n\t":"=a" (dwEip) 
    157             ); 
    158  
    159         unsigned char *dest; 
    160         unsigned char *src; 
     152        /* Added this code to get current value of EIP. */ 
     153        __asm__ volatile ( 
     154                "calll geip\n\t" 
     155                "geip: \n\t" 
     156                "popl %0\n\t" 
     157                : "=a" (dwEip) 
     158        ); 
     159 
     160        unsigned char *dest, *src; 
    161161        src = (unsigned char *)dwEip; 
    162162        dest = WAKE_RECOVER1M_CODE; 
     
    165165                dest[i] = src[i]; 
    166166 
    167         __asm__ __volatile__("ljmp $0x0010,%0"  //08 error 
     167        __asm__ __volatile__("ljmp $0x0010,%0"  /* 08 error */ 
    168168                             ::"i"((void *)(WAKE_RECOVER1M_CODE + 0x20))); 
    169169 
    170         /*added 0x20 "nop" to make sure the ljmp will not jump then halt */ 
    171         asm volatile ("nop"); 
    172         asm volatile ("nop"); 
    173         asm volatile ("nop"); 
    174         asm volatile ("nop"); 
    175         asm volatile ("nop"); 
    176         asm volatile ("nop"); 
    177         asm volatile ("nop"); 
    178         asm volatile ("nop"); 
    179         asm volatile ("nop"); 
    180         asm volatile ("nop"); 
    181  
    182         asm volatile ("nop"); 
    183         asm volatile ("nop"); 
    184         asm volatile ("nop"); 
    185         asm volatile ("nop"); 
    186         asm volatile ("nop"); 
    187         asm volatile ("nop"); 
    188         asm volatile ("nop"); 
    189         asm volatile ("nop"); 
    190         asm volatile ("nop"); 
    191         asm volatile ("nop"); 
    192  
    193         asm volatile ("nop"); 
    194         asm volatile ("nop"); 
    195         asm volatile ("nop"); 
    196         asm volatile ("nop"); 
    197         asm volatile ("nop"); 
    198         asm volatile ("nop"); 
    199         asm volatile ("nop"); 
    200         asm volatile ("nop"); 
    201         asm volatile ("nop"); 
    202         asm volatile ("nop"); 
    203  
    204         __asm__ volatile ( 
    205                                  /* set new esp, maybe ebp should not equal to esp?,  
    206                                     due to the variable in acpi_jump_wake?, anyway, this may be not a big problem. 
    207                                     and I didnt clear the area (ef000+-0x200) to zero. 
    208                                   */ 
    209                                  "movl %0, %%ebp\n\t" 
    210                                  "movl %0, %%esp\n\t"::"a" (WAKE_THUNK16_STACK) 
    211             ); 
    212  
    213         /* added this 
    214            only "src" and "dest" use the new stack, and the esp maybe also used in resumevector 
     170        /* Added 0x20 "nop" to make sure the ljmp will not jump then halt. */ 
     171        asm volatile ("nop"); 
     172        asm volatile ("nop"); 
     173        asm volatile ("nop"); 
     174        asm volatile ("nop"); 
     175        asm volatile ("nop"); 
     176        asm volatile ("nop"); 
     177        asm volatile ("nop"); 
     178        asm volatile ("nop"); 
     179        asm volatile ("nop"); 
     180        asm volatile ("nop"); 
     181 
     182        asm volatile ("nop"); 
     183        asm volatile ("nop"); 
     184        asm volatile ("nop"); 
     185        asm volatile ("nop"); 
     186        asm volatile ("nop"); 
     187        asm volatile ("nop"); 
     188        asm volatile ("nop"); 
     189        asm volatile ("nop"); 
     190        asm volatile ("nop"); 
     191        asm volatile ("nop"); 
     192 
     193        asm volatile ("nop"); 
     194        asm volatile ("nop"); 
     195        asm volatile ("nop"); 
     196        asm volatile ("nop"); 
     197        asm volatile ("nop"); 
     198        asm volatile ("nop"); 
     199        asm volatile ("nop"); 
     200        asm volatile ("nop"); 
     201        asm volatile ("nop"); 
     202        asm volatile ("nop"); 
     203 
     204        __asm__ volatile ( 
     205                /* 
     206                 * Set new esp, maybe ebp should not equal to esp?, due to the 
     207                 * variable in acpi_jump_wake?, anyway, this may be not a big 
     208                 * problem. and I didn't clear the area (ef000+-0x200) to zero. 
     209                 */ 
     210                "movl %0, %%ebp\n\t" 
     211                "movl %0, %%esp\n\t"::"a" (WAKE_THUNK16_STACK) 
     212        ); 
     213 
     214        /* 
     215         * Only "src" and "dest" use the new stack, and the esp maybe also 
     216         * used in resumevector. 
    215217         */ 
    216 #if PAYLOAD_IS_SEABIOS==1 
    217         // WAKE_MEM_INFO inited in get_set_top_available_mem in tables.c 
     218#if PAYLOAD_IS_SEABIOS == 1 
     219        /* WAKE_MEM_INFO inited in get_set_top_available_mem in tables.c. */ 
    218220        src = 
    219221            (unsigned char *)((*(u32 *) WAKE_MEM_INFO) - 64 * 1024 - 0x100000); 
    220222        dest = 0; 
    221         for (i = 0; i < 0xa0000; i++)   //if recovered 0-e0000, then  when resume, before winxp turn on the desktop screen ,there is gray background which last 1sec. 
     223 
     224        /* 
     225         * If recovered 0-e0000, then when resume, before WinXP turn on the 
     226         * desktop screen, there is gray background which last 1sec. 
     227         */ 
     228        for (i = 0; i < 0xa0000; i++) 
    222229                dest[i] = src[i]; 
    223                 /*__asm__ volatile (             
    224                                 "movl    %0, %%esi\n\t" 
    225         "movl    $0, %%edi\n\t" 
    226         "movl    $0xa0000, %%ecx\n\t" 
    227         "shrl    $2, %%ecx\n\t" 
    228         "rep movsd\n\t"     
    229         ::"a"(src)         
    230         );*/ 
    231         src = 
    232             (unsigned char *)((*(u32 *) WAKE_MEM_INFO) - 64 * 1024 - 0x100000 + 
    233                               0xc0000); 
    234         //dest = 0xc0000; 
    235         //for (i = 0; i < 0x20000; i++) 
    236         //      dest[i] = src[i];                
    237         /*      __asm__ volatile (               
    238            "movl    %0, %%esi\n\t" 
    239            "movl    $0xc0000, %%edi\n\t" 
    240            "movl    $0x20000, %%ecx\n\t" 
    241            "shrl    $2, %%ecx\n\t" 
    242            "rep movsd\n\t"     
    243            ::"a"(src)         
    244            ); */ 
    245  
    246         src = 
    247             (unsigned char *)((*(u32 *) WAKE_MEM_INFO) - 64 * 1024 - 0x100000 + 
    248                               0xe0000 + WAKE_SPECIAL_SIZE); 
    249         //dest = 0xf0000; 
    250         //for (i = 0; i < 0x10000; i++) 
    251         //      dest[i] = src[i];                
    252         __asm__ volatile ("movl    %0, %%esi\n\t" 
    253                           "movl    %1, %%edi\n\t" 
    254                           "movl    %2, %%ecx\n\t" 
    255                           "shrl    $2, %%ecx\n\t" 
    256                           "rep movsd\n\t"::"r" (src), 
    257                           "r"(0xe0000 + WAKE_SPECIAL_SIZE), 
    258                           "r"(0x10000 - WAKE_SPECIAL_SIZE) 
    259             ); 
    260  
    261         src = 
    262             (unsigned char *)((*(u32 *) WAKE_MEM_INFO) - 64 * 1024 - 0x100000 + 
    263                               0xf0000); 
    264         //dest = 0xf0000; 
    265         //for (i = 0; i < 0x10000; i++) 
    266         //      dest[i] = src[i];                
    267         __asm__ volatile ("movl    %0, %%esi\n\t" 
    268                           "movl    $0xf0000, %%edi\n\t" 
    269                           "movl    $0x10000, %%ecx\n\t" 
    270                           "shrl    $2, %%ecx\n\t" "rep movsd\n\t"::"a" (src) 
    271             ); 
     230 
     231#if 0 
     232        __asm__ volatile ( 
     233                "movl %0, %%esi\n\t" 
     234                "movl $0, %%edi\n\t" 
     235                "movl $0xa0000, %%ecx\n\t" 
     236                "shrl $2, %%ecx\n\t" 
     237                "rep movsd\n\t" 
     238                ::"a"(src) 
     239        ); 
     240#endif 
     241        src = (unsigned char *)((*(u32 *) WAKE_MEM_INFO) - 64 * 1024 
     242                        - 0x100000 + 0xc0000); 
     243 
     244#if 0 
     245        dest = 0xc0000; 
     246        for (i = 0; i < 0x20000; i++) 
     247              dest[i] = src[i]; 
     248 
     249        __asm__ volatile ( 
     250                "movl %0, %%esi\n\t" 
     251                "movl $0xc0000, %%edi\n\t" 
     252                "movl $0x20000, %%ecx\n\t" 
     253                "shrl $2, %%ecx\n\t" 
     254                "rep movsd\n\t" 
     255                ::"a"(src) 
     256        ); 
     257#endif 
     258 
     259        src = (unsigned char *)((*(u32 *) WAKE_MEM_INFO) - 64 * 1024 
     260                        - 0x100000 + 0xe0000 + WAKE_SPECIAL_SIZE); 
     261 
     262        /* dest = 0xf0000; */ 
     263        /* for (i = 0; i < 0x10000; i++) */ 
     264        /*      dest[i] = src[i]; */ 
     265        __asm__ volatile ( 
     266                "movl %0, %%esi\n\t" 
     267                "movl %1, %%edi\n\t" 
     268                "movl %2, %%ecx\n\t" 
     269                "shrl $2, %%ecx\n\t" 
     270                "rep movsd\n\t"::"r" (src), 
     271                "r"(0xe0000 + WAKE_SPECIAL_SIZE), 
     272                "r"(0x10000 - WAKE_SPECIAL_SIZE) 
     273        ); 
     274 
     275        src = (unsigned char *)((*(u32 *) WAKE_MEM_INFO) - 64 * 1024 
     276                        - 0x100000 + 0xf0000); 
     277        /* dest = 0xf0000; */ 
     278        /* for (i = 0; i < 0x10000; i++) */ 
     279        /*      dest[i] = src[i]; */ 
     280        __asm__ volatile ( 
     281                "movl %0, %%esi\n\t" 
     282                "movl $0xf0000, %%edi\n\t" 
     283                "movl $0x10000, %%ecx\n\t" 
     284                "shrl $2, %%ecx\n\t" "rep movsd\n\t"::"a" (src) 
     285        ); 
    272286 
    273287        asm volatile ("wbinvd"); 
     
    276290        asm volatile ("lidt %0"::"m" (wake_thunk16_Xgt_desc[1])); 
    277291 
    278         /* Set up a GDT from which we can load segment descriptors for real 
    279            mode.  The GDT is not used in real mode; it is just needed here to 
    280            prepare the descriptors. */ 
     292        /* 
     293         * Set up a GDT from which we can load segment descriptors for real 
     294         * mode. The GDT is not used in real mode; it is just needed here to 
     295         * prepare the descriptors. 
     296         */ 
    281297        asm volatile ("lgdt %0"::"m" (wake_thunk16_Xgt_desc[0])); 
    282298 
    283         /* Load the data segment registers, and thus the descriptors ready for 
    284            real mode.  The base address of each segment is 0x100, 16 times the 
    285            selector value being loaded here.  This is so that the segment 
    286            registers don't have to be reloaded after switching to real mode: 
    287            the values are consistent for real mode operation already. */ 
    288  
    289         __asm__ __volatile__("movl $0x0010,%%eax\n" 
    290                              "\tmovl %%eax,%%ds\n" 
    291                              "\tmovl %%eax,%%es\n" 
    292                              "\tmovl %%eax,%%fs\n" 
    293                              "\tmovl %%eax,%%gs\n" "\tmovl %%eax,%%ss":::"eax"); 
    294  
    295         /* Jump to the 16-bit code that we copied earlier.  It disables paging 
    296            and the cache, switches to real mode, and jumps to the BIOS reset 
    297            entry point. */ 
    298  
    299         __asm__ 
    300             __volatile__("ljmp $0x0008,%0"::"i" 
    301                          ((void *)(WAKE_THUNK16_ADDR - 
    302                                    sizeof(real_mode_switch) - 100))); 
     299        /* 
     300         * Load the data segment registers, and thus the descriptors ready for 
     301         * real mode.  The base address of each segment is 0x100, 16 times the 
     302         * selector value being loaded here.  This is so that the segment 
     303         * registers don't have to be reloaded after switching to real mode: 
     304         * the values are consistent for real mode operation already. 
     305         */ 
     306        __asm__ __volatile__( 
     307                "movl $0x0010,%%eax\n" 
     308                "\tmovl %%eax,%%ds\n" 
     309                "\tmovl %%eax,%%es\n" 
     310                "\tmovl %%eax,%%fs\n" 
     311                "\tmovl %%eax,%%gs\n" 
     312                "\tmovl %%eax,%%ss":::"eax" 
     313        ); 
     314 
     315        /* 
     316         * Jump to the 16-bit code that we copied earlier. It disables paging 
     317         * and the cache, switches to real mode, and jumps to the BIOS reset 
     318         * entry point. 
     319         */ 
     320 
     321        __asm__ __volatile__( 
     322                "ljmp $0x0008,%0"::"i" 
     323                ((void *)(WAKE_THUNK16_ADDR - sizeof(real_mode_switch) - 100)) 
     324        ); 
    303325} 
    304326 
     
    319341 */ 
    320342 
    321 //#include "boot.h" 
     343// #include "boot.h" 
    322344 
    323345#define MAX_8042_LOOPS  100000 
     
    430452                /* Try enabling A20 through the keyboard controller */ 
    431453                empty_8042(); 
    432 //if (a20_test_short()) 
    433 //      return 0; /* BIOS worked, but with delayed reaction */ 
     454 
     455                // if (a20_test_short()) 
     456                //      return 0; /* BIOS worked, but with delayed reaction */ 
    434457 
    435458                enable_a20_kbc();