How would a register + stack based virtual machine work? - cpu-registers

I know how register based and how stack based virtual machines work independently. I know the advantages and disadvantages of both. What I want to know is that has anyone ever tried to merge the two?
I tried to search the net for the existence of such a virtual machine, but to no avail. The best result I got was an article on a hybrid virtual machine (HyVM). If such a virtual machine was indeed created for a programming language, I would be interested in having a look at its source code to understand how it works.
Perhaps someone could point me in the right direction to find such a virtual machine, or link me to an article or blog post that elaborates in this topic.

Take a look at Forth. It uses a VM, is mainly stack oriented but allows to store values almost in the way you suggest.
In addition, the VM is quite small, so it is easy to explore and to port it.

Related

Getting started with line-rate virtual machine

I am beginning to study the use of virtual machines with realtime applications, specifically network applications.
While I do understand the limitations and concerns, I'd like to get ideas as to how to get started on this task.
I am going to use a DPDK sample application over Linux, and probably use VMWare for starters. However, I do not know what my first steps with respect to setting up VMWare should be.
First I think it is better to use open source solution like QUEM/KVM for your virtualization platform. Many platform exist for run high performance network functions on virtualized platforms you can see OpenNetVM for example in order to get basic ideas.

Where to start with Xen?

I am a newbie with Xen.I want to know how does Xen work.
It's really a puzzle when facing the code and I don't know where to start.
Are there some easy articles for me?
Since you mention looking at the code, I assume you want to understand the technical details of Xen and not just merely how to start a VM.
As with all problems, start with something simple and then work your way up. Some pointers:
Be sure to have the prerequisite experience under your belt. In particular, strong C and Linux affinity, but also x86 paging and virtualized memory workings.
Make sure you have a sound grasp of the general Xen architecture. For instance, paravirtualized versus hardware-supported virtualization, the special role of the management domain (Dom0) compared to unprivileged domains (DomU), etc.
Investigate the the Xen components running in Dom0:
The Xen control library (libxc) which implements much of the logic relating to hypercalls and adds sugar around these (look in tools/libxc).
The swiss army knife for administrating Xen, namely the Xen light library (libxl). This library replaces the deprecated xm tool with the xl tool and takes care of all your maintenance tasks such as starting/stopping a VM, listing all running VMs, etc. For all these operations, it works in tandem with the aforementioned libxc. (Libxl lives in tools/libxl.)
The Xenstore is a tree-like data structure from which all running domains can retrieve and store data. This is necessary since all I/O goes through Dom0 (not the hypervisor!), and domains need to communicate with Dom0 how they are going to pass I/O along. (Look in tools/xenstore.) You can inspect the Xenstore with a tool such as xenstore-ls.
the blkback/netback kernel drivers which pass the data over shared channels to the VMs. (You will find these drivers in a recent Linux kernel (e.g. >= v3.0) that has so-called PVOPS support).
Take a look at the console daemon (tools/console). Note that sometimes the Qemu console is actually used. Qemu also comes in the pictures as a default backend for if you choose a file-backed virtual storage for a VM.
Experiment with the 'Xen-way' of inter-VM communication: Grant tables, event channels and the Xenstore. With these fundamentals you can create your own shared channel between VMs. You can do this, for example, with writing a kernel module that you use in two domains to let them talk to each other.
I can also give some pointers in the source that you can check out:
xen/xen/include/public/xen.h will give you a list of all the hypercalls with comments what they do.
xen/xen/include/xen/mm.h gives you an introduction to the different memory terminology used by Xen (i.e., real versus virtualized addresses and page numbers). If you don't grasp these differences, then reading the hypervisor code will surely be frustrating.
xen/xen/include/asm-x86/config.h gives an overview of the memory layout of Xen.
xen/tools/libxc/xenctrl.h exports a large list of interesting domain control operations, which gives an abstract view of task division between Dom0 and the hypervisor.
Last but not least, the book 'The Definitive Guide to the Xen Hypervisor' by David Chisnall comes highly recommended. It covers all these topics and more in a thorough, technical fashion with plenty of code examples.
The Xen wiki and developer mailing lists are also a great resource for understanding Xen.
If you have a more specific question, then I can give you a more specific answer.
Here are few links which will guide you with ZEN Start up.Hope they will be useful.
http://www.howtoforge.com/howtos/virtualization/xen
http://wiki.xen.org/wiki/Category:HowTo
http://wiki.debian.org/Xen
For me, that is the best and more concrete tutorial with examples and step by step to start. I used it when I started.
Then you can read a lot more on Xen documentation itself or some books but as a starting point that allows you to easily install and test Xen, I choose that tutorial from Debian Wiki.
If you just want an overview, you may read this: http://wiki.xenproject.org/wiki/Xen_Project_Beginners_Guide.
This will introduce you to Xen hypervisor, suggest configuration to set up virtual machines, provide information about the networking and finally have details about tools for the management of virtual machines.
This documentation is to get the Xen specifically on ubuntu (Most importantly, it works!)
https://help.ubuntu.com/community/Xen
===
However, if you want to go to the next level and understand the working of Xen; Xen architecture, memory management, device management, CPU scheduling etc., I would recommend reading the book "The Definitive Guide to the Xen Hypervisor".

Hardware/Software inventory open source projects

I would like to develop a Network Inventory application that works on any operating system.
Reports on every possible resource attacehd to a network.
Reports all pertinent details of hardware and software.
Thats (and i hate to use the phrase) my "End Game".
However I am running before i can crawl here.
I have no experience of this type of development, e.g. discovering a computers hardware and software settings.
I've spent almost two weeks googling and come up short! :-(.
So I am turning to you to ask these questions:-
My first step is to find an existing open source project i can incorporate into my own code that extracts the fine grained details i am after, e.g. EVERYTHING there is to know about the hardaware and software on a single machine.
Does this project exist? or do i have to develop that first?
Have i got to write all this in C?
I am guessing getting this information about a computer is going to be easier than for printers, scanners, routers etc... e.g. everything else you would find attached to a network.
Once i have access to a single computers details i then need to investigate how i can traverse an entire newtork of printers, scanners, routers, load balancers, switches, firewalls, workstations, servers, storeage devices, laptops, monitors, the list goes on and on
One problem i have is i dont have a 1000 machine newtork to play on!
Is there any such resource available on theinternet? (is that a silly question?)
Anywho, if you dont ask you wont find out!
One aspect iam really looking forward to finding out how to travers the entire network,
should i be using TCP/IP for this?
Whats a good site, blog, usergorup, book for TCP/IP development?
How do i go about getting through firewalls?
How many questions can i ask in one go? :-)
My previous question on this topic ended up with PYTHON being championed as the language/script to go with to develop this application in.
Having looked at a few PYTHON examples they all seemed to be related to WINDOWS networks
and interrogating Windows Management Instrumentation (WMI). I had the feeling you cant rely on whats in WMI, and even if you can that s no good for UNIX netwrks.
Surely there exist common code for extracting hardware and software details from a computer? Why cant i find it on the internet?
Pease help?
Theres no prizes though :-(
Thanks in advance
I would like to appologise if i have broken forum rules or not tried hard enough on my own before asking for assistance.
I just would like to start moving forward with this as its one of the best projects i have been involved with.
I am inspired by the many differnt number of challenges involved and that if i manage to produce a useful application at the end of it it would hopefully be extremely helpful to many people.
That sit
Thanks in advance
DD
as a software vendor of a discovery solution, I can just say: Respect, that you want to start a new one :-). Just in case you are interested in what it could look like: http://www.jdisc.com
Now to some of our experience:
Programming Language:
I wouldn't write it in C. Use Java or .NET. Those languages have great advantages when it comes to tracking down errors or problems. For instance, in Java (and I guess also in .NET), you can see the stack trace when something is failing. For some pieces of code (e.g. WMI access), you might need to use C++ or C (e.g. access to native APIs from Microsoft). Use a native interface or a COM bridge from Java. In .NET, it should even be easier to access the Windows APIs).
Devices:
well, network printers, router, and switches are actually easier to discover. They usually expose their information via SNMP. SNMP is pretty easy to use and pretty robust. Getting information from Windows (or even Unix) systems is a bit trickier. Protocols can be blocked, misconfigured, messed up... We had cases, where WMI was simply hanging when requesting data from a remote device.
Test Devices:
Since we are also a smaller company, we also do not have 1000 different devices to test with. But, there are some things that might help:
a) For SNMP devices use a SNMP simulator. We use MIMIC 9.0 from Gambit Solutions and we are pretty happy with it. You can import SNMP walks from network devices and simulate the device as if it would be in your network.
b) Secondly, use virtualization whenever possible. With VMware, you can install Windows, Linux, or even Solaris. We also use a project called GNS3 to emulate Cisco Routers, Firewalls or Juniper routers.
c)You can test the rest of the devices only, if you have a customer that helps you with testing and implementing new devices.
This are just some ideas to start with. But I have to tell you, that it is not trivial and it takes a lot of time....
Hope that you got some ideas to start with...
I don't know that it's open source, but we use Spiceworks (http://www.spiceworks.com) here as an IT management platform. You may get some use out of exploring that.

Hosting ASP.NET - knowledgeable programmer, hosting noob - Scaling and Speed Question

Apologies for this huge question.....please bear with me and try to help :)
Previous employers have all had in house hosting or people other than me to deal with that side of stuff and all my personal projects (ie low traffic) have been comfortably handled by servergrid.com who allow any number of domains even in their basic package.
I am about to take on more serious projects and have little clue about hosting, the questions to ask and what to look for. Some basic research has been done but I am honestly confused by the number of metrics involved when main thing i care about is SPEED & SCALING.
I have noticed that servergrid db servers for instance shares many 100s DB users/server so I imagine a shared package where your paying just 2$/month for sql server, tho a bargain, is not going to scale beyond a hobby site.
So:
is moving to a dedicated or virtual dedicated server the simple answer to speed and the only real metric I need to worry about?
dedicated pricing is a big jump on servergrid - are there premium shared services that don't put a bazillion people on the server - it doesn't seem obvious from the sites, would it make a huge difference?
the landscape seems to changing in a big way - IIS7 and Server 2008 seem to have all these
features like Isolated Application Pools/ Hyper V, are these just BS hype or things that seriously help with scaling and speed?
Lastly cloud hosting (specifically http://www.rackspacecloud.com) - it runs .NET right, is it fundamentally architecturally different to anything else or just use of the word cloud for marketing? It looks v cool - but is it just normal hosting with a different billing model and a somewhat easier way to scale? Is this similar to the much hyped squarespace hosted blog/site system?
Sorry for my rambling style of question and would be deeply grateful for someone who can just in relatively plain english sweep away some of my basic misconceptions....
Thanks!
Okay, take a look at Amazon Web Services. They are very flexible in terms of infrastructure (both hardware and software) and I find their rates to be ok. Also, their business model revolves around "using" not "leasing" (ie you pay based on what you use, for how long, etc).
I think it's a good starting point.
Since your main concern is "speed" & "scale" you may also take a look at Windows Azure and SQL Azure
Windows Azure
A nice brief video explanation by Steve Marx.
What is Windows Azure
I would stay away from shared hosting for a "more serious" production deployment. Amazon's AWS is as good a place to start as any (rackspace has a similar service which now supports self-provisioning). Failing that, you might carefully evaluate how much scale you really need. If you know how many users you'll have and have any idea what their usage patterns will be, then get dedicated hosting to fit. If the number of your users is unknown and unpredictable, and their usage will be spiky, then go with AWS.
That would be my first-pass approach. YMMV, and it will take time to fine-tune your own approach.

Slicehost installation profile

I'm no UNIX Guru, but I've had to set up a handful of slices for various web projects. I've used the articles on there to set up users, a basic firewall, nginx or apache, and other bits and pieces of a basic web server.
I foresee more slice administration in my future. Is there a more efficient way to set up users, permissions, and software on a clean slice than configuration by hand?
It sounds like you can create a new slice from the backup of an existing one. This might not work for you if the slices would be different sizes, different distros, etc. Their forums mention this: Clone a slice?
Depending on the number of machines you might find it makes sense to use something like CFEngine, or Puppet, to configure the new installs.
That brings your work down to configuring each new machine as a CFEngine, for example, client. Then that may be used to install the packages, edit files, & etc.
There are a few articles I wrote on the subject, with a Debian bias, here:
http://www.debian-administration.org/tag/cfengine

Resources