Changeset 195 for trunk/hal


Ignore:
Timestamp:
Jul 13, 2017, 12:28:37 PM (4 years ago)
Author:
max@…
Message:

add IOC (ATA)

Location:
trunk/hal/x86_64/core
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/hal/x86_64/core/hal_context.c

    r193 r195  
    5252
    5353        /* set cpu context pointer in thread */
    54         thread->cpu_context = (void*)context;
     54        thread->cpu_context = (void *)context;
    5555
    5656        /* build the context */
  • trunk/hal/x86_64/core/hal_cpu.S

    r166 r195  
    7070        ret
    7171
     72ASM_ENTRY(in16)
     73        movq    %rdi,%rdx
     74        xorq    %rax,%rax
     75        inw     %dx,%ax
     76        ret
     77
    7278ASM_ENTRY(out8)
    7379        movq    %rdi,%rdx
    7480        movq    %rsi,%rax
    7581        outb    %al,%dx
     82        ret
     83
     84ASM_ENTRY(out16)
     85        movq    %rdi,%rdx
     86        movq    %rsi,%rax
     87        outw    %ax,%dx
    7688        ret
    7789
  • trunk/hal/x86_64/core/hal_init.c

    r192 r195  
    151151}
    152152
     153static void init_bootinfo_ioc(boot_device_t *dev)
     154{
     155        memset(dev, 0, sizeof(boot_device_t));
     156
     157        dev->base = 0;
     158        dev->type = (DEV_FUNC_IOC << 16) | IMPL_IOC_BDV;
     159        dev->channels = 1;
     160}
     161
    153162static void init_bootinfo_pic(boot_device_t *dev)
    154163{
     
    203212        info->io_cxy = 0;
    204213
    205         info->ext_dev_nr = 2;
     214        info->ext_dev_nr = 3;
    206215        init_bootinfo_txt(&info->ext_dev[0]);
    207216        init_bootinfo_pic(&info->ext_dev[1]);
     217        init_bootinfo_ioc(&info->ext_dev[2]);
    208218
    209219        info->cxy = 0;
  • trunk/hal/x86_64/core/hal_internal.h

    r168 r195  
    3737uint64_t rdtsc();
    3838uint8_t in8(uint32_t port);
     39uint16_t in16(uint32_t port);
    3940void out8(uint32_t port, uint8_t val);
     41void out16(uint32_t port, uint16_t val);
    4042uint64_t rdmsr(uint32_t);
    4143void wrmsr(uint32_t, uint64_t);
Note: See TracChangeset for help on using the changeset viewer.