IO configuration language

Martin Schröder martin.schroeder at openlimit.com
Wed Jun 25 17:11:29 CEST 2014


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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: arm-rv.io.old
Type: application/x-trash
Size: 225 bytes
Desc: not available
URL: <http://os.inf.tu-dresden.de/pipermail/l4-hackers/attachments/20140625/217099f6/attachment.old>
-------------- next part --------------
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"));
  };
}


-------------- next part --------------
-- 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");


More information about the l4-hackers mailing list