Re: IO configuration language

Martin Schröder <[email protected]>
Newsgroups gmane.comp.micro-kernel.l4.devel
Message-ID <[email protected]>
Am 24.06.2014 23:27, schrieb Adam Lackorzynski:
> So setting the name is possible. It should work like this:
>          client0 = Io.Vi.System_bus(function ()
> 	      _self["x.y"] = wrap(...);
>          end),
>
> with table style it looks a bit cleaner:
>          client0 = Io.Vi.System_bus{
> 	      ["x.y"] = wrap(...),
>          };
>
> (I'm not sure it works with the _self syntax for you).

_self does not work:
> io      | rom/arm-rv.io: error executing lua config: rom/arm-rv.io:18: attempt to index global '_self' (a nil value)

table style does not work either: l4linux is at booting, but card is not 
probed.

There must be some dark mystery in the old configuration %)


I've attached the old (working) and new configuration for use with the 
L4Linux ARM example (Realview ARM9 on qemu). (smsc911x driver was added 
to linux kernel).


Martin

_______________________________________________
l4-hackers mailing list
[email protected]
http://os.inf.tu-dresden.de/mailman/listinfo/l4-hackers
arm-rv.io.old (application/x-trash, 225 B) - not displayed
arm-rv.io.new (text/plain, 371 B)
local Hw = Io.Hw
local Res = Io.Res

Io.hw_add_devices
{
  NIC = Hw.Device
  {
    hid = "smsc911x";
    Res.mmio(0x4e000000, 0x4e000fff);
    Res.irq(60);
  }
}

Io.add_vbusses
{
--[[
  l4lx = Io.Vi.System_bus( function ()
    _self["smsc911x"] = wrap(Hw:match("smsc911x"));
  end),
--]]

l4lx = Io.Vi.System_bus{
    ["smsc911x"] = wrap(Hw:match("smsc911x"));
  };
}
l4lx.cfg (text/plain, 739 B)
-- vim:set ft=lua:

require("L4")

local lxname = "vmlinuz";
if L4.Info.arch() == "arm" then
  lxname = "vmlinuz.arm";
end

local loader = L4.default_loader;

local io_buses =
  {
    vbus0 = loader:new_channel();
  };

loader:start(
  { caps = {
      sigma0  = L4.cast(L4.Proto.Factory,L4.Env.sigma0):create(L4.Proto.Sigma0),
      icu     = L4.Env.icu,
      l4lx    = io_buses.vbus0:svr(),
    },
  }, "rom/io -vvv rom/arm-rv.io");

loader:start(
  { caps = {
      log = L4.Env.log:m("rws"),
      vbus = io_buses.vbus0,
    },
    l4re_dbg = L4.Dbg.Warn,
    log = { "l4linux", "yellow" },
  },
  "rom/" .. lxname .. " mem=64M console=ttyLv0 l4x_rd=rom/ramdisk-" ..  L4.Info.arch() .. ".rd root=1:0 ramdisk_size=4000 init=/bin/sh");
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.