flat assembler
Message board for the users of flat assembler.
Index
> OS Construction > Hypervisor from Blue Pill ported to FASM? Goto page 1, 2 Next |
Author |
|
booter 22 Jan 2010, 05:17
I always prefer to start with something workig
My idea is to port Blue Pill to FASM first. Then play with it adding new functionality and learning. Learn how to run several VMs. Learn how to control ACPI and provide "hardware partitioning" (splitting hardware between VMs). Establish inter-VM communications (develop protocols). Write (port from QEMU) device emulators. Develop specifications on virtual hardware, write emulators (to export virtual hardware) and drivers (to use virtual hardware in existing OS). The result would be something close to what I brifly explained here http://board.flatassembler.net/topic.php?t=11068 Obviously it's a project for several(many?) years However, virtualization is a very popular and interesting topic. Such development would be an adventures and educational for anybody. What about making it FASM community project? I specifically mean Hypervisor that would provide multi-VM environment and distribute physical hardware among VMs. |
|||
22 Jan 2010, 05:17 |
|
sinsi 22 Jan 2010, 07:17
Just reverse-engineer hyper-v, it will be easier.
>pissing contest hasn't that got 'bigger' lately... |
|||
22 Jan 2010, 07:17 |
|
Feryno 22 Jan 2010, 12:16
forget bluepill, start your own project, I may give you some advices but I'm not allowed to post skeleton/executable of hypervisor written in FASM
- at first you must be able to do some simple driver written in FASM (download it from forum or from FASM download section) - then you may extend the driver to start the hypervisor: - allocate notpageable memory - prepare hypervisor data / registers / stack space (a lot of things to do, set up correctly about 100 things or even slightly more, the most of time consumes studying CPU system manuals) - prepare handler for vm_exits - for intel CPU it is approx at least 100 instructions for the minimal skeleton - for all unconditional vm exits at intel CPU - should be less instructions for AMD CPU (I didn't that yet for AMD) - launch it - if you manage to launch it at 1 cpu, then you may think about SMP support (I suggest you to start SMP support from begin of project, if you start it later, you will have a lot of things to edit/change) if you manage to run the hypervisor, then you may start to be interested how to shut down running hypervisor - you may find some ideas in one presentation at Myjava 2009 FASM conference to have some image about the size of project, the skeleton (*.sys driver) would be about 12 kB for 64 bit mode hypervisor (yesterday I counted that one specialized hypervisor performing some specialized tasks had code written in FASM with about 3900 instructions, but the bare skeleton should be about half of that) disassembling hyper-v... a waste of time, ask some questions here prepare yourself to be resistant to BSODs and reboots (may be at range of 10 or more reboots per 1 day) btw writing hypervisor is something like writing minimal OS, you will prepare the same system things, only for hypervisor you must set them more complicatelly into VMCS (Intel) (AMD names it differently), for OS you will write them directly, currently there is no free emulator emulating virtualization so you must launch hypervisor at bare CPU, if you are developping an OS you may launch it under some emulator and save time by reboots and recoveries from reboots for the skeleton, you don't need community, you may do it yourself |
|||
22 Jan 2010, 12:16 |
|
tom tobias 22 Jan 2010, 13:42
booter wrote: My idea is to port Blue Pill to FASM first. Feryno wrote: forget bluepill, To the more serious question, and the rationale for this post: Do we have a list, finally, of motherboards capable of supporting this technology? Last I heard, Don and Martin had run around like the proverbial chicken sans tete seeking a motherboard that would run their exotic software.... Is this hypervisor based only on "virtualization", or does it require the more advanced replacement for the traditional BIOS? If it only runs on Intel Core I7, that's fine, but it will be another decade before I can afford one.... |
|||
22 Jan 2010, 13:42 |
|
Borsuc 22 Jan 2010, 17:53
On one hand you say RAM is cheap, on the other you say i7 is so expensive that you need a decade to afford it.
Weird as it gets. |
|||
22 Jan 2010, 17:53 |
|
tom tobias 22 Jan 2010, 18:39
http://www.pricewatch.com/gallery/cpu/i7-860
My entire computer costs less than this. |
|||
22 Jan 2010, 18:39 |
|
vid 23 Jan 2010, 14:26
tom tobias wrote: To the more serious question, and the rationale for this post: Do we have a list, finally, of motherboards capable of supporting this technology? Last I heard, Don and Martin had run around like the proverbial chicken sans tete seeking a motherboard that would run their exotic software.... Since then, the technology of course became present in more CPUs. Quote: Is this hypervisor based only on "virtualization", or does it require the more advanced replacement for the traditional BIOS? Nothing extra is needed in BIOS for virtualization to work. |
|||
23 Jan 2010, 14:26 |
|
Borsuc 23 Jan 2010, 20:20
tom tobias wrote: http://www.pricewatch.com/gallery/cpu/i7-860 _________________ Previously known as The_Grey_Beast |
|||
23 Jan 2010, 20:20 |
|
f0dder 24 Jan 2010, 17:08
Feryno wrote: currently there is no free emulator emulating virtualization so you must launch hypervisor at bare CPU, if you are developping an OS you may launch it under some emulator and save time by reboots and recoveries from reboots vid wrote:
Some BIOSes disable VMX support though, and won't let you enable the feature. Dunno if it's done to sell "VMX capable motherboards" at a higher price tag, or if there might be some legitimate reasons (ie, BIOS having SMM code that somehow conflicts with VMX). |
|||
24 Jan 2010, 17:08 |
|
booter 26 Jan 2010, 01:29
Feryno wrote: forget bluepill, start your own project, I may give you some advices but I'm not allowed to post skeleton/executable of hypervisor written in FASM As I mentioned, the idea with blue pill was to begin with something that already works. Otherwise I would not know where to look for a problem if it all (as you said approx 2000 lines of code) just doesn't work I need some initial core to provide debugging/logging capabilities. I feel more comfortable with boot loaders then with drivers, so initial loading of the Hypervisor is not a problem (though handling "interceptions" of some OS booting in real mode may be uneasy). I hope you won't mind taking a look at my first code (when I write one) to see what's wrong As soon as it begins working I would be able to get some debugging info and then go by myself. |
|||
26 Jan 2010, 01:29 |
|
Feryno 26 Jan 2010, 09:10
hi booter
I may read it and try to find possible problems I'm working on hypervisor at Intel CPU (skeleton seems to be very stable, currently I'm implementing parts watching and doing some things to running guest OS) perhaps when I finish that I may port its skeleton to AMD virtualization also do you want to implement your hypervisor for intel or for amd? loading through bootloader - no problem (I'm loading it under running OS as a driver because request for watching and controlling running guest OS) what guest do you then plane to run after you load hypervisor at boot stage and which way your guest will be loaded (if your guest will be loaded through 16 bit BIOS routines, then you will need to emulate 16 bit instructions under Intel - for AMD there is a special mode so no necessity to emulate 16 bit instructions) I just wanted to say, that for Intel CPU - establishing hypervisor itself is a bit less complicated than correctly running a guest then... if you plane to do it through boot loader, then running a guest may be even more difficult |
|||
26 Jan 2010, 09:10 |
|
booter 04 Feb 2010, 18:42
Feryno wrote: hi booter I'm going to go with AMD. The reasons are: - I don't like Intel's "manners" (how it bevaves and where it goes). - I have some AMD PCs to play with. - AMD provides free public version of the SimNow™ Simulator that looks like the right tool for the job, see http://developer.amd.com/Assets/SimNowUsersManual4.5.2.pdf |
|||
04 Feb 2010, 18:42 |
|
Feryno 05 Feb 2010, 08:47
Yes, if I remember correctly, AMD implemented virtualization before intel so AMD is leader.
The first intel virtualization wasn't complete - perhaps because implementing it in hurry (AMD was ahead) - e.g. lacked virtualization of guest memory, intel had to release the second version. But the first intel VMX version was enough for me to watch running guest and intercept events necessary in my project (accessing guest memory wasn't problem for me without its virtualization, I simple map any physical memory into hypervisor virtual memory space - but if it was virtualized, memory accesses would be faster). AMD has also the chance of "paged real mode" so you can easier run 16 bit guest under 64 bit hypervisor. I didn't start to port hypervisor from intel into AMD yet (perhaps I'll do it when tasks done under current intel version will be stable). Thanks for tip, I'll try AMD simulator. I recently tried bochs 2.4.2 which is capable to do intel vmx emulation. |
|||
05 Feb 2010, 08:47 |
|
Feryno 05 Feb 2010, 09:09
SimNow is available here:
http://developer.amd.com/cpu/simnow/Pages/default.aspx (free registration required) to run it - it requires Linux 64 bit or x64 version of windows XP/2003 server (I have both platforms already installed in both my home PCs) - so I may start to play with it. |
|||
05 Feb 2010, 09:09 |
|
edfed 05 Feb 2010, 19:49
maybe reactos is something like you want.
it is a virtual hardware (win32) with a set of drivers from XP. it is still at an advanced development stautus, (like a win3.11). but it is not fasm coded. |
|||
05 Feb 2010, 19:49 |
|
f0dder 05 Feb 2010, 19:52
edfed: reactos has nothing to do with virtualization whatsoeve; it's simply an alternative implementation of the NT kernel. And it's much further technology-wise than Win3.x, you can't compare them at all.
A CPU emulator like bochs, funnily enough mentioned above, is useful for testing. edfed wrote: but it is not fasm coded. |
|||
05 Feb 2010, 19:52 |
|
edfed 05 Feb 2010, 20:02
Quote: Who cares, usability is not determined by what something is written in. of course yes it does. if you write an OS in asm, and then, put a compiler inside the os with enough privilege to modify in real time running code, it will give a great usability. a usability that gives you the power to add a special feature with only a single compilation of ASM in real time. for other languages, it is the same problem, and the same solution. make a real time run & compile of all code in the ram. (or virtual ram). it increases usability and capability with a single feature. that's why the language of a system is important. in my opinion. |
|||
05 Feb 2010, 20:02 |
|
booter 06 Feb 2010, 11:37
edfed, "usability" is not my goal and we don't discuss "regular" OS on this thread.
I'm going to develop Hypervisor that would protect OS components from each other because "by design" I'm going to treat each OS component as potentially dangerous Ideally, protection from intentionally harmful hardware is also desirable |
|||
06 Feb 2010, 11:37 |
|
bitRAKE 07 Feb 2010, 01:06
Y'all seen the rkanalyzer project? (Based on BitVisor.)
|
|||
07 Feb 2010, 01:06 |
|
Goto page 1, 2 Next < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.