// Description   : RING1 kernel extension with File System of the NANO OS

// Copyright     : Proxima Centauri Romania SRL, ALL RIGHTS RESERVED. (http://www.ProximaCentauri.org)

// Author        : Alexander Ioan Mihail

 

#ifndef ring1_h

#define ring1_h 1

 

#include "nano.h"

 

START_NAMESPACE(NANO_RING1)

using namespace NANO_CORE;

CLASS CAT_RING1;

CLASS DEVICE;

 

struct DIRECTORY : public ELEMENT

{

  COMMON_DECLARATIONS(DIRECTORY,ELEMENT)

  public:

      virtual int Evaluate (int phase, int param1);

      virtual void Expand (BOND* aspect, bool on);

      virtual void GetPath (char* path);

};

 

struct DEVICE : public ELEMENT

{

  COMMON_DECLARATIONS(DEVICE,ELEMENT)

  public:

      virtual int Evaluate (int phase, int param1);

};

 

struct DRIVE : public DIRECTORY

{

  COMMON_DECLARATIONS(DRIVE,DIRECTORY)

  public:

      virtual void GetPath (char* path);

};

 

struct SENSOR : public DEVICE

{

  COMMON_DECLARATIONS(SENSOR,DEVICE)

  public:

      virtual int Evaluate (int phase, int param1);

      int CheckDrives (char* key);

      void CheckDevices ();

      void CheckDrive (char* key, DEVICE* dev);

};

 

struct CAT_RING1 : public CAT_CORE

{

  COMMON_DECLARATIONS(CAT_RING1,CAT_CORE)

  typedef enum

  {

    em_FILE,

    em_DRIVE,

    em_DIRECTORY,

    em_DEVICE,

    em_POS,

    em_SENSOR,

    rel_System,

    rel_Sensor,

    em_Max

  } ETypes;

 

  public:

      CAT_RING1 (ELEMENT* container, ELEMENT* parent, char* name, ELEMENT* type, void* start, void* end);

      void* operator new (size_t sz, void* ptr);

      static CAT_RING1* KernelInit ();

      static bool KernelDone (CAT_RING1* kernel);

      ELEMENT Types[em_Max];

};

 

#define eqCDPL "CoreDispatcherPauseLength="

END_NAMESPACE(NANO_RING1)

 

#endif