Wheels-Of-Fire

Forum Replies Created

Viewing 20 posts - 41 through 60 (of 1,996 total)
  • Author
    Posts
  • in reply to: C++ Programming #68990
    Wheels-Of-FireWheels-Of-Fire
    Participant
      @grahamdearsley
      Forumite Points: 4

      I should have mentioned that the newish Windows Terminal has control codes enabled as standard (if you haven’t got it already its on the Windows store) plus lots of other stuff.

      I haven’t yet figured out how to make my compiled programs launch in Terminal though 🙄

      in reply to: Free Windows 11 Enterprise VM Machine with lots of goodies #68989
      Wheels-Of-FireWheels-Of-Fire
      Participant
        @grahamdearsley
        Forumite Points: 4

        Quite nice, and I would have given it a go but…

        Apart from only having Pro, not enterprise, and not having setup WSL, I already have all that up and running on my PC 😁

        The other thing is, I have Visual Studio 2022 64 bit installed.

        It would have been nice if I had known about that VM earlier though, because it took an age to get everything set up and working.

        in reply to: C++ Programming #68962
        Wheels-Of-FireWheels-Of-Fire
        Participant
          @grahamdearsley
          Forumite Points: 4

          As part of Microsoft’s push to make the console more Linux like they have reintroduced support for control codes, last seen in DOS with the ANSI driver installed.

          They are calling it ” Console Virtual Terminal Sequences” and they have to be enabled before you can use them. Below is some C++ (if swap cout for printf then its C) that enables Terminal Sequences safely and uses a code to move the cursor.

          #include<iostream>
          #include<wchar.h>
          #include<windows.h>
          #include<conio.h>

          using namespace std;

          int main()
          {

          HANDLE hOut = GetStdHandle(STD_OUTPUT_HANDLE);

          if (hOut == INVALID_HANDLE_VALUE)
          {
          return false;
          }

          HANDLE hIn = GetStdHandle(STD_INPUT_HANDLE);

          if (hIn == INVALID_HANDLE_VALUE)
          {
          return false;
          }

          DWORD dwOriginalOutMode = 0;
          DWORD dwOriginalInMode = 0;

          if (!GetConsoleMode(hOut, &dwOriginalOutMode))
          {
          return false;
          }

          if (!GetConsoleMode(hIn, &dwOriginalInMode))
          {
          return false;
          }

          DWORD dwRequestedOutModes = ENABLE_VIRTUAL_TERMINAL_PROCESSING | DISABLE_NEWLINE_AUTO_RETURN;
          DWORD dwRequestedInModes = ENABLE_VIRTUAL_TERMINAL_INPUT;

          DWORD dwOutMode = dwOriginalOutMode | dwRequestedOutModes;

          if (!SetConsoleMode(hOut, dwOutMode))
          {
          return -1;
          }

          DWORD dwInMode = dwOriginalInMode | ENABLE_VIRTUAL_TERMINAL_INPUT;

          if (!SetConsoleMode(hIn, dwInMode))
          {
          return -1;
          }

          cout << “blink”;

          cout << “\x1B[10;20fHello”;

          cout << “\x1B[11;20fWorld” << endl;
          }

          You don’t actually need to #include <wchr.h> or <conio.h> but my longer test program uses them.

          in reply to: SD card locked. #68947
          Wheels-Of-FireWheels-Of-Fire
          Participant
            @grahamdearsley
            Forumite Points: 4
            in reply to: C++ Programming #68945
            Wheels-Of-FireWheels-Of-Fire
            Participant
              @grahamdearsley
              Forumite Points: 4

              I have been looking into C++ move semantics and rvalue references. First of all this

              int a=10;

              I can get a reference to “a” with &a, it is an lvalue, but I can’t get a reference to 10 because it is a literal and therefore an rvalue.

              in reply to: Windows 11 #68894
              Wheels-Of-FireWheels-Of-Fire
              Participant
                @grahamdearsley
                Forumite Points: 4

                My PC has an ICH10R chip because it came out just before they moved to the PCH setup. Just for fun I downloaded the Intel data sheet for it.

                Apparently there are 3 versions of the ICH10, standard, raid and corporate raid. I have the raid.

                The ONLY difference between the raid and the corporate raid is that the corporate has a built in TPM, its only version 1.2 though so I would still be stuffed for W11 😁

                The other thing I noticed was that the chip has a Serial Peripheral Interface. SPI is mostly used to connect the BIOS chip but its also used to connect a TPM.

                SPI can be used to connect several devices but my motherboard only supports two, and I have dual BIOS, so no SPI socket for a TPM 🙄

                in reply to: Surface Pro 7 Knackered. #68768
                Wheels-Of-FireWheels-Of-Fire
                Participant
                  @grahamdearsley
                  Forumite Points: 4

                  Well no, like I said,multiple forced shutdowns did nothing, the system just kept restarting at the screen with the 4 white squares because it hadn’t actually shut down.

                  This will be something to do with the Windows 10 fast start up feature that I already knew about, choosing shutdown from the start menu actually puts the system in a form of hibernation.

                  A restart is still a restart that reloads all memory from scratch but rebooting after a shut down does not.

                  I had no idea that a forced shutdown would work the same way but it does.

                  This must be tied into the UEFI settings somehow too because holding down the volume button on the Surface when it boots is meant to bring up the UEFI menu, but it didn’t, and the system didn’t even look at a bootable USB stick.

                  So my problem was, how to force a restart when Windows wouldn’t load ?

                  The answer was to keep my finger on the power button for another 10 seconds after a forced shutdown.

                  in reply to: Surface Pro 7 Knackered. #68762
                  Wheels-Of-FireWheels-Of-Fire
                  Participant
                    @grahamdearsley
                    Forumite Points: 4

                    On a side note, Microsoft support was about as much use as a chocolate fire guard, after reading to me from a script for about 20 minutes they finally said that, as the Surface is still under warranty, my only option was to send it back to them, at my expense, for repair. If it turned out to be a real fault then they would refund the postage.

                    in reply to: Surface Pro 7 Knackered. #68761
                    Wheels-Of-FireWheels-Of-Fire
                    Participant
                      @grahamdearsley
                      Forumite Points: 4

                      I could have gotten to a command prompt from the Windows installation USB stick if the Surface Pro had taken any notice of it, but it didn’t.

                      I solved the problem by chance an hour ago.

                      For reasons only known to Microsoft, or the writers of UEFI, even a forced shutdown was not a proper shutdown, the computer was still trying to resume a failed firmware update.

                      I discovered that if you hold your finger on the power button it does a forced shutdown, which didn’t help, but if you hold your finger on the button for another 10 seconds it does a proper forced restart, that solved the problem.

                      The first thing that Windows did when it restarted was to tell me that I had an urgent firmware update pending 🥶

                      Fortunately it all worked this time.

                      in reply to: AMD chipset not recognised #68718
                      Wheels-Of-FireWheels-Of-Fire
                      Participant
                        @grahamdearsley
                        Forumite Points: 4

                        Installers shouldn’t really fail silently these days. Ever since Vista, a programs manifest should have an entry that says whether it requires elevation and that should produce a UAC dialogue box.

                        However, if you do come across a rogue program then it may still be worth using “Run as administrator”, even if you are logged in as an admin.

                        The reason is that, since Vista, admins normally run with a standard user security token and only switch to their admin token when requested by UAC or by using “run as”.

                        Processes also inherit their token from their parent so if you launch a program from an elevated command prompt then it will also run elevated.

                        Sorry if i’m stating the obvious to some people 😁

                        in reply to: Comercial rig #68694
                        Wheels-Of-FireWheels-Of-Fire
                        Participant
                          @grahamdearsley
                          Forumite Points: 4

                          Nearly as flexible as a self build is configuring your own from one of the specialist suppliers.

                          Some of my favorites are palicomp, scan and ccl computers.

                          All those sites let you pick and choose components with a running price total.

                          in reply to: Razer Nightmare for SysAdmins #68675
                          Wheels-Of-FireWheels-Of-Fire
                          Participant
                            @grahamdearsley
                            Forumite Points: 4
                            in reply to: Razer Nightmare for SysAdmins #68674
                            Wheels-Of-FireWheels-Of-Fire
                            Participant
                              @grahamdearsley
                              Forumite Points: 4

                              How the hell did this get past the Microsoft WHQL testing ?

                              The Windows PnP manager does indeed run from the System account so it can do its job of installing drivers.

                              If the PnP manager can’t find a driver locally it will visit Windows Update and look for a driver that supports the device ID it just got, if it finds one it will download and install it.

                              The system is meant for signed drivers, not user mode installation programs.

                              Someone at MS must have been asleep when they allowed THIS driver to be signed and put on Windows Update !

                              in reply to: SSD Puzzle #68670
                              Wheels-Of-FireWheels-Of-Fire
                              Participant
                                @grahamdearsley
                                Forumite Points: 4

                                Thats a Windows Hardware Error Architecture bug check and it normally relates to core hardware like memory or CPU.

                                One popular cause is an over heating CPU having its thermal warning triggered and sending a message to Windows, which then shuts down the system to protect data.

                                So you may well be right about the heat.

                                One other thing. The thermal warning feature came in with 6th Gen Core i CPU’s

                                in reply to: Windows is mostly just a database ! #68505
                                Wheels-Of-FireWheels-Of-Fire
                                Participant
                                  @grahamdearsley
                                  Forumite Points: 4

                                  Oh, and it all works because the address the CPU is using is only real to the CPU, the physical memory that gets accessed it determined by page tables that the CPU’s memory management unit uses. Each processes has its own set of tables in kernel address space.

                                  in reply to: Windows is mostly just a database ! #68504
                                  Wheels-Of-FireWheels-Of-Fire
                                  Participant
                                    @grahamdearsley
                                    Forumite Points: 4

                                    Tricky to explain, but the thing to understand is that a CPU can only execute one instruction at a time and that instruction must be in physical memory.

                                    Windows keeps track of what should be in physical memory through its data structures.

                                    in reply to: Windows is mostly just a database ! #68501
                                    Wheels-Of-FireWheels-Of-Fire
                                    Participant
                                      @grahamdearsley
                                      Forumite Points: 4

                                      Well nearly Keith

                                      X Box OS is now a full copy of Windows 10, it previously only had the direct x api and a cut down core of Windows but it now has the whole thing.

                                       

                                      in reply to: Windows is mostly just a database ! #68500
                                      Wheels-Of-FireWheels-Of-Fire
                                      Participant
                                        @grahamdearsley
                                        Forumite Points: 4

                                        You should see the data structures that go along with events !

                                        Its either going to be a scheduled event or an interupt and they both have massive structures that govern what they do.

                                        Even an app requested operation like a file read/write starts with the creation of a data structure called an i/o request packet.

                                        in reply to: Windows 11 #68486
                                        Wheels-Of-FireWheels-Of-Fire
                                        Participant
                                          @grahamdearsley
                                          Forumite Points: 4

                                          Windows 11 is also now avaliable on the insider beta channel, they are suggesting that people switch to that if they wan’t to see the near release version.

                                          The Dev channel will shortly be seeing more experimental builds.

                                          in reply to: Windows 11 #68467
                                          Wheels-Of-FireWheels-Of-Fire
                                          Participant
                                            @grahamdearsley
                                            Forumite Points: 4

                                            Ah. Sometimes these problems can be caused by settings IN the guest OS, like having the display set to 720p when you’re using a 4K monitor,Doh 😆

                                          Viewing 20 posts - 41 through 60 (of 1,996 total)