tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] lcall invalid hex code


From: Sergey Korshunoff
Subject: Re: [Tinycc-devel] lcall invalid hex code
Date: Mon, 2 May 2016 05:31:00 +0300

> What is invalid? Is the actual constant incorrect

Yes. Strange, but the actual constant was invalid. Catched by trap of
the tccboot with PCI bus configuration turned on (PCnet-PCI II for
VirtualBox).  lcall constant is used only in assmbler code.

pci-pc.c (linux 2.4.37.11)
static struct {
    unsigned long address;
    unsigned short segment;
} bios32_indirect = { 0, __KERNEL_CS };

/*
 * Returns the entry point for the given service, NULL on error
 */

static unsigned long bios32_service(unsigned long service)
{
    unsigned char return_code;<>/* %al */
    unsigned long address;<----><------>/* %ebx */
    unsigned long length;<-----><------>/* %ecx */
    unsigned long entry;<------><------>/* %edx */
    unsigned long flags;

    __save_flags(flags); __cli();
    __asm__("lcall (%%edi); cld"
        : "=a" (return_code),
          "=b" (address),
          "=c" (length),
          "=d" (entry)
        : "0" (service),
          "1" (0),
          "D" (&bios32_indirect));
        __restore_flags(flags);

    switch (return_code) {
        case 0:
            return address + entry;
        case 0x80:      /* Not present */
            printk(KERN_WARNING "bios32_service(0x%lx): not
present\n", service);
            return 0;
        default: /* Shouldn't happen */
            printk(KERN_WARNING "bios32_service(0x%lx): returned 0x%x
-- BIOS bug!\n",
            service, return_code);
    }
}

A right constant value was detected by comparing *.o produced by gcc
and tcc (objdump -Dtsr test.o)

PS: I'm going to use tcc for compilation of the openvz-2.6.32 kernel.
This is the current kernel on the my notebook: openvz containers,
different drivers (acronis TrueImage, parallels ufsd, aufs, android
binder and ashmem), 32 and 64 versions, Compilation of this kernel for
the ARM processors is waiting.

https://github.com/seyko2/openvz_rhel6_kernel_mirror

cellRocks patches are published on gitthub and partially ported to
this kernel too (todo on my whish list)
https://github.com/Cellrox/devns-patches



reply via email to

[Prev in Thread] Current Thread [Next in Thread]