EECE-4029 Operating Systems Fall 2016
Linux OS

processes, mutex, semaphores, memory management, producer-consumer, files, deadlock, more..

How does the OS know where the hardware is

    OS routines need to be portable: they should not change from system to system, even though systems may be quite different. Hence, locations and capabilities must be defined for every system.
BIOS Data Area (BDA):
The BDA is only partially standardized, and mainly obsolete. However, it contains the address of the Extended BIOS Data Area (EBDA) which is where the OS needed information about hardware is located.

Include files for ACPI routines are in /usr/src/kernels/linux-3.10.2/include/acpi. ACPI drivers are in /usr/src/kernels/linux-3.10.2/drivers/acpi and /usr/src/kernels/linux-3.10.2/drivers/acpi/acpica.
  • include/acpi/actbl.h
    Holds basic ACPI table definitions. The following is the internal ACPI table descriptor: there is one per ACPI table.
       struct acpi_table_desc {
          acpi_physical_address address;
          struct acpi_table_header *pointer;
          u32 length; /* Length fixed at 32 bits */
          union acpi_name_union signature;
          acpi_owner_id owner_id;
          u8 flags;
  • include/acpi/acconfig.h
    Defines global configuration constants and is copyrighted by Intel. Important defines include:
       #define ACPI_EBDA_PTR_LOCATION 0x0000040E
       #define ACPI_EBDA_WINDOW_SIZE 1024
       #define ACPI_HI_RSDP_WINDOW_BASE 0x000E0000
       #define ACPI_HI_RSDP_WINDOW_SIZE 0x00020000
  • drivers/acpi/acpica/aclocal.h
    Internal table management struct defined:
       struct acpi_table_list {
          struct acpi_table_desc *tables; /* Table descriptor array */
          u32 current_table_count; /* Tables currently in the array */
          u32 max_table_count; /* Max tables array will hold */
          u8 flags;
  • drivers/acpi/acpica/acglobal.h
       extern struct acpi_table_list acpi_gbl_root_table_list;
  • drivers/acpi/acpica/tbxfroot.c
    Finds the root ACPI table which is called RSDT. The function that does this is acpi_find_root_pointer which is called with a pointer (just of type unsigned 32 or 64 bits) that will be filled with the address. A status is returned as well. The pointer, called Root System Description Pointer (RSDP), is supplied by acpi_os_get_root_pointer of acpi/osl.c which returns the address obtained from acpi_find_root_pointer.
  • drivers/acpi/acpica/tbxface.c
    An important function in this file is acpi_initialize_tables which initializes the table manager and gets the RSDP and RSDT. It is passed an initial_table_array pointer of type acpi_table_desc. If this pointer is NULL a new table is allocated via acpi_allocate_root_table of acpi/acpica/tbxface.c. That table is either copied from an existing table referred to by acpi_gbl_root_table_list or is freshly allocated. If the pointer is not NULL then a new table is allocated and copied to init_table_array and that becomes the new acpi_gbl_root_table_list. Then all entries of the RSDT are extracted to the local root table array (in a more usable form).