# main.c File Reference

`#include <ubixos/init.h>`
`#include <sys/gdt.h>`
`#include <sys/video.h>`
`#include <sys/tss.h>`
`#include <ubixos/exec.h>`
`#include <ubixos/kpanic.h>`
`#include <ubixos/systemtask.h>`
`#include <vfs/mount.h>`
`#include <lib/kprintf.h>`
`#include <lib/kmalloc.h>`

Include dependency graph for main.c:

Go to the source code of this file.

## Defines

#define | B_ADAPTOR(val) (((val) >> B_ADAPTORSHIFT) & B_ADAPTORMASK)
#define | B_ADAPTORMASK 0x0f
#define | B_ADAPTORSHIFT 24
#define | B_CONTROLLER(val) (((val)>>B_CONTROLLERSHIFT) & B_CONTROLLERMASK)
#define | B_CONTROLLERMASK 0xf
#define | B_CONTROLLERSHIFT 20
#define | B_PARTITION(val) (((val) >> B_PARTITIONSHIFT) & B_PARTITIONMASK)
#define | B_PARTITIONMASK 0xff
#define | B_PARTITIONSHIFT 8
#define | B_SLICE(val) (((val)>>B_SLICESHIFT) & B_SLICEMASK)
#define | B_SLICEMASK 0xff
#define | B_SLICESHIFT 20
#define | B_TYPE(val) (((val) >> B_TYPESHIFT) & B_TYPEMASK)
#define | B_TYPEMASK 0xff
#define | B_TYPESHIFT 0
#define | B_UNIT(val) (((val) >> B_UNITSHIFT) & B_UNITMASK)
#define | B_UNITMASK 0xf
#define | B_UNITSHIFT 16

## Functions

int | kmain (uInt32 rootdev)
| This is the entry point into the os where all of the kernels sub systems are started up.
| ubixDescriptorTable (ubixGDT, 9)

## Variables

struct {
descriptorTableUnion *gdt | __attribute__ ((packed))
unsigned short limit | __attribute__ ((packed))
} | loadGDT

## Define Documentation

#define B_ADAPTOR | ( | val |  | ) | (((val) >> B_ADAPTORSHIFT) & B_ADAPTORMASK)

Definition at line 43 of file main.c.

Referenced by kmain().

#define B_ADAPTORMASK 0x0f

Definition at line 42 of file main.c.

#define B_ADAPTORSHIFT 24

Definition at line 41 of file main.c.

#define B_CONTROLLER | ( | val |  | ) | (((val)>>B_CONTROLLERSHIFT) & B_CONTROLLERMASK)

Definition at line 46 of file main.c.

Referenced by kmain().

#define B_CONTROLLERMASK 0xf

Definition at line 45 of file main.c.

#define B_CONTROLLERSHIFT 20

Definition at line 44 of file main.c.

#define B_PARTITION | ( | val |  | ) | (((val) >> B_PARTITIONSHIFT) & B_PARTITIONMASK)

Definition at line 55 of file main.c.

Referenced by kmain().

#define B_PARTITIONMASK 0xff

Definition at line 54 of file main.c.

#define B_PARTITIONSHIFT 8

Definition at line 53 of file main.c.

#define B_SLICE | ( | val |  | ) | (((val)>>B_SLICESHIFT) & B_SLICEMASK)

Definition at line 49 of file main.c.

Referenced by kmain().

#define B_SLICEMASK 0xff

Definition at line 48 of file main.c.

#define B_SLICESHIFT 20

Definition at line 47 of file main.c.

#define B_TYPE | ( | val |  | ) | (((val) >> B_TYPESHIFT) & B_TYPEMASK)

Definition at line 58 of file main.c.

Referenced by kmain().

#define B_TYPEMASK 0xff

Definition at line 57 of file main.c.

#define B_TYPESHIFT 0

Definition at line 56 of file main.c.

#define B_UNIT | ( | val |  | ) | (((val) >> B_UNITSHIFT) & B_UNITMASK)

Definition at line 52 of file main.c.

Referenced by kmain().

#define B_UNITMASK 0xf

Definition at line 51 of file main.c.

#define B_UNITSHIFT 16

Definition at line 50 of file main.c.

## Function Documentation

int kmain | ( | uInt32 | rootdev | ) |

This is the entry point into the os where all of the kernels sub systems are started up.

Parameters:

  | rootdev | address of root device structure

Definition at line 97 of file main.c.

References B_ADAPTOR, B_CONTROLLER, B_PARTITION, B_SLICE, B_TYPE, B_UNIT, clearScreen(), execFile(), execThread(), vitalsStruct::freePages, init_tasks, init_tasksTotal, irqEnable(), kmalloc(), kpanic(), kprint(), kprintf(), NULL, systemTask(), systemVitals, vfs_mount(), vmmMemoryMap, x1, and x2000.

Here is the call graph for this function:

ubixDescriptorTable | ( | ubixGDT | ,
|  | 9 |  |
| ) |  |  |

Definition at line 76 of file main.c.

References dBig, dBiglim, dCode, dData, dDpl3, dLdt, dRead, dTss, dWrite, and ubixStandardDescriptor.

## Variable Documentation

struct { ... } loadGDT