aboutsummaryrefslogtreecommitdiffstats
path: root/core/fs/lib/loadconfig.c
blob: 9318c1c32fdb92ee676d2a904311012ba3cae81c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include <dprintf.h>
#include <stdio.h>
#include <string.h>
#include <core.h>
#include <fs.h>

/*
 * Standard version of load_config for extlinux-installed filesystems
 */
int generic_load_config(void)
{
    com32sys_t regs;

    chdir(CurrentDirName);
    realpath(ConfigName, "extlinux.conf", FILENAME_MAX);

    dprintf("Config = %s\n", ConfigName);

    memset(&regs, 0, sizeof regs);
    regs.edi.w[0] = OFFS_WRT(ConfigName, 0);
    call16(core_open, &regs, &regs);

    return (regs.eflags.l & EFLAGS_ZF) ? -1 : 0;
}