Commit Graph

61 Commits

Author SHA1 Message Date
andrewfish f70c2a1234 InOsEmuPkg: Fix Xcode symbol loading with new scheme. Fix bug in dlcose. Move some of the gdb infrastrucuture to the start of main().
signed-off-by: andrewfish



git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11895 6f19259b-4bc3-4df7-8a09-765794883524
2011-06-27 19:56:15 +00:00
andrewfish febb227679 InOsEmuPkg: Fix minor typo and Xcode build breaks. Seems Xcode is more picky about the types you pass into %x.
signed-off-by: andrewfish



git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11893 6f19259b-4bc3-4df7-8a09-765794883524
2011-06-27 15:42:03 +00:00
jljusten 984d7448fe InOsEmuPkg/Unix: Allow binary UEFI shell to be used
When using InOsEmuPkg/Unix/build64.sh -D USE_NEW_SHELL,
the UEFI shell binary will now be included in the firmware
image.

Signed-off-by: jljusten

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11889 6f19259b-4bc3-4df7-8a09-765794883524
2011-06-26 18:58:23 +00:00
jljusten 0bc9421b14 InOsEmuPkg/Unix: Auto-load symbols files in gdb
Images that can't be loaded with dlopen are
added to SecMain.gdb.

Whenever gdb stops, the hook-stop macro will automatically
load the symbol files.

Signed-off-by: jljusten

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11888 6f19259b-4bc3-4df7-8a09-765794883524
2011-06-26 18:58:10 +00:00
andrewfish 8e4b3d32a8 InOsEmuPkg: Make the Guard MemoryAllocationLib handle EFI allocated pages correctly.
signed-off-by: andrewfish



git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11887 6f19259b-4bc3-4df7-8a09-765794883524
2011-06-25 01:39:09 +00:00
andrewfish 1d7ac5a617 InOsEmuPkg: Add an OS malloc/valloc/free based implementation of the MemoryAllocationLib. Requires extra Thunk APIs.
I've got this working. The tricky part was a driver/application can mix malloc forms. If the driver links against this library all the allocations come from the OS service, but if a protocol or EFI boot service return an allocated buffer it will still use the EFI allocation. The gasket code can detect this and do the right thing, as the emulator is passing up the memory map to EFI. 

You can now use the OS based malloc debugging tools in an EFI driver or appliaction. On OS X this is libgmalloc, also called guard malloc. 

Signed-off-by: andrewfish.



git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11886 6f19259b-4bc3-4df7-8a09-765794883524
2011-06-24 23:59:51 +00:00
andrewfish 0de7effb73 InOsEmuPkg: Fix issue with struct stat not having the right size. EFI compiler args are not compatible with system include headers for IA32.
This is a fix for XCODE/XCLANG. I'm still seeing an issue, but the stat info for the filesystem is now correct. 

Signed-off-by: andrewfish



git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11885 6f19259b-4bc3-4df7-8a09-765794883524
2011-06-24 22:48:34 +00:00
andrewfish c8f62f95a6 [InOsEmuPkg] Fix minor coding style bug.
signed-off-by: andrewfish



git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11884 6f19259b-4bc3-4df7-8a09-765794883524
2011-06-24 14:50:06 +00:00
andrewfish c217506815 [InOSEmPkg] Add OS malloc and free to the Thunk.
Added OS malloc and free so we can make MemoryAllocationLib instance that uses OS guard malloc. This will allow all the debug support built into the OS for finding malloc bugs to be used with a driver in the emulator. 

Signed-off-by: andrewfish



git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11883 6f19259b-4bc3-4df7-8a09-765794883524
2011-06-24 14:48:38 +00:00
jljusten 54e0b04c74 InOsEmuPkg/Unix: Fix build issues for GCC44 IA32
Signed-off-by: jljusten

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11880 6f19259b-4bc3-4df7-8a09-765794883524
2011-06-23 15:23:39 +00:00
jljusten 27f6b4f869 InOsEmuPkg/Unix: Detect lib directory suffix on Linux
For IA32 builds, if /lib32 and /usr/lib32 exist,
they will be used instead of /lib and /usr/lib.

For X64 builds, if /lib64 and /usr/lib64 exist,
they will be used instead of /lib and /usr/lib.

Signed-off-by: jljusten

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11879 6f19259b-4bc3-4df7-8a09-765794883524
2011-06-23 15:23:20 +00:00
jljusten feceaad588 InOsEmuPkg/Unix/build.sh: Merge changes from build64.sh r11867
Signed-off-by: jljusten

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11878 6f19259b-4bc3-4df7-8a09-765794883524
2011-06-23 15:23:02 +00:00
jljusten fe7e504faa InOsEmuPkg/Unix: Auto-run emulator in gdb
Signed-off-by: jljusten

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11877 6f19259b-4bc3-4df7-8a09-765794883524
2011-06-23 15:22:49 +00:00
andrewfish 1ef41207dc InOsEmuPkg: Add TimerLib for PEI, DXE_CORE, and DXE/EFI drivers/applications.
Start using MdeModulePkg MetronomeDxe driver. Add PEI and DXE_CORE TimerLibs that just call back to the emulator. Add a DXE/UEFI TimerLib that also does a gBS->WaitForEvent() if the stall is for a long period of time. Change the Thunk API for Sleep to nanoseconds. 

Signed-off-by: andrewfish


git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11872 6f19259b-4bc3-4df7-8a09-765794883524
2011-06-21 23:41:31 +00:00
andrewfish ea203f2215 InOsEmuPkg: Make sure to skip DXE IPL on emulator build, and don't double build every thing IA-32 Xcode.
Signed-off-by: andrewfish


git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11868 6f19259b-4bc3-4df7-8a09-765794883524
2011-06-20 23:05:43 +00:00
jljusten 53a6813fd0 InOsEmuPkg/Unix: Enable single-pass build with Linux
For Linux builds the thunk layer ('SEC') and main platform
firmware image will be built in a single build pass.

Signed-off-by: jljusten

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11867 6f19259b-4bc3-4df7-8a09-765794883524
2011-06-20 21:58:22 +00:00
jljusten b8800fc547 InOsEmuPkg/Unix/Sec: Add BaseMemoryLib implementation to thunk layer
This implementation only covers a few BaseMemoryLib functions.
The implementation leverates malloc/free in stdlib.

Signed-off-by: jljusten

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11866 6f19259b-4bc3-4df7-8a09-765794883524
2011-06-20 21:58:05 +00:00
jljusten 7af94c1d0a InOsEmuPkg/Unix/Sec: Fix EFIAPI usage inconsistencies
Signed-off-by: jljusten

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11865 6f19259b-4bc3-4df7-8a09-765794883524
2011-06-20 21:57:43 +00:00
jljusten d7dd93876b InOsEmuPkg: Remove unreference local variables
GCC44 will flag a warning for these unused variables.

Signed-off-by: jljusten

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11864 6f19259b-4bc3-4df7-8a09-765794883524
2011-06-20 21:57:27 +00:00
andrewfish 1453e7736e InOsEmuPkg: Fix debug prints from DXE/UEFI drivers.
Turning on serial prints for early drivers, turned off debug prints for DXE/UEFI drivers. Add them back in via report status code.

signed-off-by: andrewfish


git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11857 6f19259b-4bc3-4df7-8a09-765794883524
2011-06-19 18:59:00 +00:00
andrewfish ab34fe8b48 InOsEmuPkg: Remove unneeded Framework for XCODE linker flag overrides.
signed-off-by: andrewfish



git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11856 6f19259b-4bc3-4df7-8a09-765794883524
2011-06-19 18:57:56 +00:00
andrewfish b02333caa6 InOsEmuPkg: Fix issue with EFI_LBA not being implemented as a UINT64 in the IA-32 Gasket.
Also clean up some missing EFIAPI.

signed-off-by: andrewfish



git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11855 6f19259b-4bc3-4df7-8a09-765794883524
2011-06-19 18:56:13 +00:00
andrewfish f2f008b435 InOsEmuPkg: Fix UINT64 bugs in IA-32 gasket.
At this point IA-32 emulator boots the shell with an X11 GOP window. Block IO seems to have an issue that needs to be debugged. 

Signed-off-by: andrewfish



git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11854 6f19259b-4bc3-4df7-8a09-765794883524
2011-06-19 02:58:32 +00:00
andrewfish 102d35ba76 InOsEmuPkg: Fix issues with stack alignment in the gasket.
There are still issues with the IA-32 gasket code. Mostly having to do with yank put bugs not accounting for UINT64 returns and arguments. Currently the IA-32 build crashes in the timer callback since it is UINT64, function ptr but the gasket is UINTN UINTN. 

Signed-off-by: andrewfish



git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11853 6f19259b-4bc3-4df7-8a09-765794883524
2011-06-19 02:25:37 +00:00
andrewfish aac0fea79f InOsEmuPkg: Fix IA-32 SEC temp ram code.
Now we crash early in DXE Core.

Signed-off-by: andrewfish



git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11852 6f19259b-4bc3-4df7-8a09-765794883524
2011-06-18 23:36:36 +00:00
andrewfish e7523e0619 InOsEmuPkg: Make build dir different for IA-32. Fix PCD XIP issues.
Signed-off-by andrewfish



git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11851 6f19259b-4bc3-4df7-8a09-765794883524
2011-06-18 22:23:46 +00:00
andrewfish 417a8020ab InOsEmuPkg: Add an Xcode project file for building and debugging IA-32 Unix emulator.
Signed-off-by: andrewfish



git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11850 6f19259b-4bc3-4df7-8a09-765794883524
2011-06-18 18:40:45 +00:00
andrewfish 112a857f61 InOsEmuPkg: Unix emulator now compiles for IA-32.
Wrote IA-32 (align stack to 16-bytes) gaskets for emulator and got it to compile for IA-32. TempRam switch code is not ported to IA-32 in Sec. Code crashes in Sec. 

Signed-off-by: andrewfish



git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11849 6f19259b-4bc3-4df7-8a09-765794883524
2011-06-18 17:53:31 +00:00
andrewfish 0bc26da2bf InOsEmuPkg: Fix Linux compile issues in BlockIo code.
singed-off-by: andrewfish



git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11847 6f19259b-4bc3-4df7-8a09-765794883524
2011-06-17 21:43:45 +00:00
andrewfish 57c7d70ff9 InOsEmuPkg: Implement gIdleLoopEventGuid.
Added a CpuSleep () API to the Emulator Thunk. We needed to do this as the Stall() works hard to not get broken by the timer tic (POSIX signal). nanosleep() gets interrupted by the timer signal so it is a good emulator of a CpuSleep(); I was also able to remove some stalls in the X11 keyboard and mouse checking events, now that the gIdleLoopEventGuid was added.

Signed-off-by: andrewfish



git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11846 6f19259b-4bc3-4df7-8a09-765794883524
2011-06-17 18:21:16 +00:00
andrewfish a1e23d485b InOsEmuPkg: Fix typo in comment of previous submit.
Signed-off-by: andrewfish



git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11844 6f19259b-4bc3-4df7-8a09-765794883524
2011-06-17 16:21:02 +00:00
andrewfish 5dcda296a4 InOsEmuPkg: Add support for mounting CD-ROM images.
Devices get the block size via ioctl, but for a file the block size needs to be set. Default to 512, but optionally allow other values, like 2048/0x800 for ISO CD-ROM images. Also updated the comments in .DSC and .DEC files.

Signed-off-by: andrewfish



git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11843 6f19259b-4bc3-4df7-8a09-765794883524
2011-06-17 16:18:14 +00:00
andrewfish bfa084fad9 InOsEmuPkg: Clean up coding standards.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11839 6f19259b-4bc3-4df7-8a09-765794883524
2011-06-16 18:28:12 +00:00
andrewfish 2b59fcd5b3 InOsEmuPkg: Update code to support BerkeleyPacketFilter, and add a template for LinuxPacketFilter.
BerkelyPacketFilter seems to work. Some one else will need to use the BerkeleyPacketFilter as a template and implement the LinuxPacketFilter. I don't think it will be that hard, as they are simular. 

Signed-off-by: andrewfish



git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11828 6f19259b-4bc3-4df7-8a09-765794883524
2011-06-15 18:51:30 +00:00
andrewfish a0aab286ec InOsEmuPkg: Update DevicePathTextLib to the latest MdeModulePkg patch on the mailing list.
This library is not currently used as it requires pending updates to the MdeModulePkg.


git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11827 6f19259b-4bc3-4df7-8a09-765794883524
2011-06-15 18:46:15 +00:00
andrewfish 572287f8bb InOsEmuPkg: Add the EFI parts of the Simple Network Protocol
This only adds the EFI parts and not the OS specific implementation. Since the EFI parts no longer use system include files this is safe to do. Also fix two minor typos. 

Signed-off-by:andrewfish



git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11781 6f19259b-4bc3-4df7-8a09-765794883524
2011-06-09 19:31:56 +00:00
andrewfish 21ce7a4179 InOsEmuPkg: Fix reconnect -r from the shell
Signed-off-by: andrewfish



git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11772 6f19259b-4bc3-4df7-8a09-765794883524
2011-06-08 22:31:29 +00:00
andrewfish 946bfba2c3 InOsEmuPkg: Make XIP work properly
Update the InOsEmuPkg to properly function with XIP. Make the Recovery FV read only. Remove the use of global variable writes from XIP code. Add a new global page that can be used in place of writting to the FD by XIP code. Think of this global page as a system SRAM. 

igned-off-by: andrewfish



git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11771 6f19259b-4bc3-4df7-8a09-765794883524
2011-06-08 21:52:21 +00:00
andrewfish 8052c4a2b9 Update the FD mapping so the volatile areas write back to the FD file. Currently they are only mapped as a memory copy of the file. This also make FV read only.
The current scheme maps a file into a memory buffer. You can write to the memory buffer, but if you restart the emulator the data is not written back to the FD. Since the build, rebuilds the FD it will blow away any changes. You can now set variables and restart the emulator and they are still set. There is a bug if the FV is set to write protect that still needs to be tracked down.



git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11761 6f19259b-4bc3-4df7-8a09-765794883524
2011-06-08 04:32:18 +00:00
andrewfish 7e284acb40 Add support for SerialPortLib that maps into POSIX StdIn and StdOut. Add a device path text to lib as a holding point waiting on getting it reviewed for other packages. Some minor fixes. Also map the FV as writable, so the Variable store becomes writable.
I plan to try and make only the Variable store and logs writable, and make the executable/compressed FV read only in a future checkin. 



git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11760 6f19259b-4bc3-4df7-8a09-765794883524
2011-06-08 02:34:12 +00:00
andrewfish 19545fd9ef Fix minor build break.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11756 6f19259b-4bc3-4df7-8a09-765794883524
2011-06-07 06:28:48 +00:00
andrewfish 63947cc4d0 InOsEmuPkg: Fixed mounting device nodes and .dmg files in the emulator.
There is some Linux specific code for mounting device nodes that needs to be tested. It may not compile!

Singed-off-by: andrewfish



git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11754 6f19259b-4bc3-4df7-8a09-765794883524
2011-06-07 02:28:08 +00:00
andrewfish 033d0e5ff6 Get BlockIo mapping interfaces working. Still need to work on detecting block size of devices, but you can map a .dmg file no problem at this point.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11724 6f19259b-4bc3-4df7-8a09-765794883524
2011-06-03 03:31:32 +00:00
andrewfish d59326d3a8 Add BlockIO support to the emulator, still needs testing. Also update Emulator start code to only pass 2 args in place of 3. The 3rd argument is not needed. Still need a function as the BaseLib functoin does not have the correct calling conventions. Cleanup build script for binary shell case.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11718 6f19259b-4bc3-4df7-8a09-765794883524
2011-05-31 20:23:36 +00:00
andrewfish 8b6d0c057f Cleanup MpService interface. Still needs more testing, but now it is much closer to PI spec.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11669 6f19259b-4bc3-4df7-8a09-765794883524
2011-05-17 03:48:27 +00:00
jljusten e332b442b9 InOsEmuPkg/Unix: Return scan code for Pause key
Port of UnixPkg r11659 change.

Signed-off-by: jljusten

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11663 6f19259b-4bc3-4df7-8a09-765794883524
2011-05-16 04:47:53 +00:00
jljusten 10d1be3ed9 InOsEmuPkg: Rename EmuPthreadThunk to EmuThreadThunk
This reflects that the threading system may vary in the
OS/thunk layer.

Signed-off-by: jljusten

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11662 6f19259b-4bc3-4df7-8a09-765794883524
2011-05-16 04:47:40 +00:00
jljusten a80e595de8 InOsEmuPkg PcdEmuFileSystem: Set to architecture independent path
Signed-off-by: jljusten

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11661 6f19259b-4bc3-4df7-8a09-765794883524
2011-05-16 04:47:14 +00:00
jljusten 0c493bf4ac InOsEmuPkg PosixFileSystem: Fix memory corruption issue
Signed-off-by: jljusten

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11660 6f19259b-4bc3-4df7-8a09-765794883524
2011-05-16 04:47:00 +00:00
andrewfish 8f0067d76d Fix minor clang build issue.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11654 6f19259b-4bc3-4df7-8a09-765794883524
2011-05-15 17:34:49 +00:00