aboutsummaryrefslogtreecommitdiffstats
path: root/menu/syslinux.c
blob: 40b357f723ec32916ed306f436874918ac0b3237 (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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/* -*- c -*- ------------------------------------------------------------- *
 *
 *   Copyright 2004 Murali Krishnan Ganapathy - All Rights Reserved
 *
 *   This program is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation, Inc., 53 Temple Place Ste 330,
 *   Bostom MA 02111-1307, USA; either version 2 of the License, or
 *   (at your option) any later version; incorporated herein by reference.
 *
 * ----------------------------------------------------------------------- */

#include "syslinux.h"
#include "biosio.h"

static inline int asm_issyslinux(void)
{
  unsigned long eax, ebx, ecx, edx;

  asm("movb $0x30,%%ah ; int $0x21"
      : "=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx));

  return (eax == 0x53590000) && (ebx == 0x534c0000) &&
    (ecx == 0x494e0000) && (edx == 0x55580000);
}

char issyslinux()
{
   return asm_issyslinux();
}

static inline void asm_runcommand(char *cmd)
{
  asm volatile("int $0x22" : : "a" (0x0003), "b" (cmd));
}

void runcommand(char *cmd)
{
   asm_runcommand(cmd); 
}

static inline void asm_gototxtmode()
{
  asm volatile("int $0x22" : : "a" (0x0005));
}
   
void gototxtmode()
{
   asm_gototxtmode();
}